From b278a261e0391c6d282217292a2650ca766f8928 Mon Sep 17 00:00:00 2001 From: liaoxujun@qq.com <liaoxujun@qq.com> Date: 星期二, 01 八月 2023 17:30:45 +0800 Subject: [PATCH] 增加枚举注释显示,增加redis服务 --- DocumentServiceAPI.Web.Core/Startup.cs | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs index 012346f..984c08d 100644 --- a/DocumentServiceAPI.Web.Core/Startup.cs +++ b/DocumentServiceAPI.Web.Core/Startup.cs @@ -1,8 +1,11 @@ -锘縰sing Furion; +锘縰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.Json.Serialization; namespace DocumentServiceAPI.Web.Core; @@ -11,12 +14,14 @@ public void ConfigureServices(IServiceCollection services) { services.AddConsoleFormatter(); - services.AddJwt<JwtHandler>(); + services.AddJwt<JwtHandler>(); services.AddCorsAccessor(); - services.AddControllers() - .AddInjectWithUnifyResult(); + services.AddControllers().AddJsonOptions(options => + options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); ; + services.AddInjectWithUnifyResult<DSRESTFulResultProvider>(); + } public void Configure(IApplicationBuilder app, IWebHostEnvironment env) @@ -31,7 +36,7 @@ app.UseRouting(); app.UseCorsAccessor(); - + app.UseAuthentication(); app.UseAuthorization(); -- Gitblit v1.9.1