From 61d764804c3c9798c5763abfa5627b61a3722603 Mon Sep 17 00:00:00 2001 From: "boxu.zheng" Date: Tue, 22 Aug 2023 17:11:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=90=E4=BA=A4=E6=9C=80?= =?UTF-8?q?=E5=A4=A7=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoreHttpApiHostModule.cs | 1 + .../Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs | 12 ++++++++++++ 2 files changed, 13 insertions(+) diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs index 84e46d947..cbe8fbf3f 100644 --- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs +++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/StoreHttpApiHostModule.cs @@ -1,6 +1,7 @@ using System.IO; using System.Text.Json.Serialization; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Volo.Abp; diff --git a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs index 49586cc1f..6d8f3e1f9 100644 --- a/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs +++ b/be/Modules/Shared/src/Win_in.Sfs.Shared.Host/ModuleBase.cs @@ -16,8 +16,10 @@ using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Mvc.ApiExplorer; +using Microsoft.AspNetCore.Server.Kestrel.Core; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Internal; using Microsoft.EntityFrameworkCore.Storage; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -65,6 +67,16 @@ public abstract class ModuleBase : AbpModule where T : AbpModule var cfg = context.Services.GetConfiguration(); ServiceConfigurationContext.SetConsoleTitleOfWebApp(Assembly.GetEntryAssembly().GetName().Name); LimitedResultRequestDto.MaxMaxResultCount = 100000; + //接口请求限制 + context.Services.Configure(options => + { + options.Limits.MaxRequestBodySize = int.MaxValue; + }); + context.Services.Configure(x => + { + x.ValueLengthLimit = int.MaxValue; + x.MultipartBodyLengthLimit = int.MaxValue; + }); //context.Services.AddAgileConfig(); PreConfigureServices(context);