From 90858c80d9921b555119f41060c1f883f6e6ffc5 Mon Sep 17 00:00:00 2001
From: username@email.com <yzy2002yzy@163.com>
Date: 星期四, 26 十二月 2024 12:49:35 +0800
Subject: [PATCH] 提交

---
 DocumentServiceAPI.Web.Core/Startup.cs |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs
index bc0d34b..adb37ab 100644
--- a/DocumentServiceAPI.Web.Core/Startup.cs
+++ b/DocumentServiceAPI.Web.Core/Startup.cs
@@ -1,9 +1,14 @@
 锘縰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,13 +17,17 @@
     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());
+              // options.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create();
+           }); ;
+         services.AddInjectWithUnifyResult<DSRESTFulResultProvider>();
+
     }
 
     public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
@@ -28,7 +37,7 @@
             app.UseDeveloperExceptionPage();
         }
 
-        app.UseHttpsRedirection();
+       // app.UseHttpsRedirection();
 
         app.UseRouting();
 

--
Gitblit v1.9.1