From fbf108da3ebb58b28ed57faaf912831ce03a5dff Mon Sep 17 00:00:00 2001 From: qwj <qwjzorro@163.com> Date: 星期四, 03 八月 2023 16:34:51 +0800 Subject: [PATCH] 修改启动配置,上传文件大小限制 --- DocumentServiceAPI.Web.Core/Startup.cs | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs index 498596b..984c08d 100644 --- a/DocumentServiceAPI.Web.Core/Startup.cs +++ b/DocumentServiceAPI.Web.Core/Startup.cs @@ -5,6 +5,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using System.Text.Json.Serialization; namespace DocumentServiceAPI.Web.Core; @@ -17,7 +18,8 @@ services.AddCorsAccessor(); - services.AddControllers(); + services.AddControllers().AddJsonOptions(options => + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); ; services.AddInjectWithUnifyResult<DSRESTFulResultProvider>(); } -- Gitblit v1.9.1