fix post body is null & portal issue

This commit is contained in:
Lewis Zou
2020-04-22 18:58:26 +08:00
parent 9af89d1474
commit 5e75bdf2fd
4 changed files with 9 additions and 3 deletions
+2 -2
View File
@@ -4,8 +4,8 @@
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<Version>5.0.0-beta3</Version>
<FileVersion>5.0.0.1</FileVersion>
<Version>5.0.0-beta4</Version>
<FileVersion>5.0.0.4</FileVersion>
<Authors>zlzforever@163.com;</Authors>
<Copyright>Copyright 2018 Lewis Zou</Copyright>
<Description>DotnetSpider, a .NET Standard web crawling library. It is lightweight, efficient and fast high-level web crawling &amp; scraping framework</Description>
@@ -234,6 +234,11 @@ namespace DotnetSpider.Portal.Controllers.API
.ToDictionaryAsync(x => x.Id, x => x);
foreach (var item in @out.Data)
{
if (!dict.ContainsKey(item.Batch))
{
continue;
}
var statistics = dict[item.Batch];
if (statistics != null)
{
@@ -13,6 +13,7 @@ using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
using Serilog;
using SwiftMQ.DependencyInjection;
namespace DotnetSpider.Sample.samples
{
@@ -122,7 +122,7 @@ namespace DotnetSpider.Agent
stringContent.Content,
Encoding.GetEncoding(stringContent.EncodingName), stringContent.MediaType);
}
else if (content is ByteArrayContent byteArrayContent)
else if (content is ByteArrayContent byteArrayContent && byteArrayContent.Bytes != null)
{
httpRequestMessage.Content = new System.Net.Http.ByteArrayContent(byteArrayContent.Bytes);
}