From a161b6f9ad92f645c20fb3b35ad5617490e7f6d2 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期四, 31 八月 2023 13:13:35 +0800 Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/DocumentService --- DocumentServiceAPI.Web.Core/Startup.cs | 17 ++++++++++++----- 1 files changed, 12 insertions(+), 5 deletions(-) diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs index fa37eb2..126af8e 100644 --- a/DocumentServiceAPI.Web.Core/Startup.cs +++ b/DocumentServiceAPI.Web.Core/Startup.cs @@ -1,9 +1,13 @@ 锘縰sing DocumentServiceAPI.Core; +using DocumentServiceAPI.Model; using Furion; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; +using System.Text.Encodings.Web; +using System.Text.Json.Serialization; +using System.Text.Unicode; namespace DocumentServiceAPI.Web.Core; @@ -12,14 +16,17 @@ public void ConfigureServices(IServiceCollection services) { services.AddConsoleFormatter(); - services.AddJwt<JwtHandler>(); - //娣诲姞Sqlsugar - services.AddSqlsugarSetup(App.Configuration); + services.AddJwt<JwtHandler>(); services.AddCorsAccessor(); - services.AddControllers() - .AddInjectWithUnifyResult(); + services.AddControllers().AddJsonOptions(options => + { + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter()); + // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(); + }); ; + services.AddInjectWithUnifyResult<DSRESTFulResultProvider>(); + } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) -- Gitblit v1.9.1