From b80a3aa37ac5bed12dd6c49e9e731d5f375f80d9 Mon Sep 17 00:00:00 2001
From: 移动系统liao <liaoxujun@qq.com>
Date: 星期四, 26 十二月 2024 09:55:01 +0800
Subject: [PATCH] 增加sw文档关闭配置
---
DocumentServiceAPI.Web.Core/Startup.cs | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/DocumentServiceAPI.Web.Core/Startup.cs b/DocumentServiceAPI.Web.Core/Startup.cs
index 3b828ae..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;
@@ -16,8 +21,13 @@
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)
@@ -27,7 +37,7 @@
app.UseDeveloperExceptionPage();
}
- app.UseHttpsRedirection();
+ // app.UseHttpsRedirection();
app.UseRouting();
--
Gitblit v1.9.1