From e88e7a7413d78dc960aa4723215f813ae4d2d6ea Mon Sep 17 00:00:00 2001
From: z8018 <1282578289@qq.com>
Date: 星期二, 26 八月 2025 14:21:10 +0800
Subject: [PATCH] 1

---
 WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs b/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
index 4f4e913..8369112 100644
--- a/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
+++ b/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -106,12 +106,15 @@
 app.UseMiniProfiler();//性能分析器
 app.ConfigureApplication();//配置文件
 app.UseApplicationSetup();//启动配置
+
+app.UseAllServicesMiddle(builder.Services);
+
 app.UseSession();
-if (app.Environment.IsDevelopment())
+//if (app.Environment.IsDevelopment())
 {
     //todo
-    //app.UseSwaggerAuthorized();
-    app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html"));
+    app.UseSwaggerAuthorized();
+    app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html") ?? throw new Exception("未找到WIDESEAWCS_Server.index.html文件"));
 }//判断是否需要打开swagger
 
 app.UseIpLimitMiddle();
@@ -119,7 +122,7 @@
 //todo
 //app.UseRecordAccessLogsMiddle();
 
-app.UseCors(AppSettings.app(new string[] { "Cors", "PolicyName" }));
+app.UseCors(AppSettings.Get(new string[] { "Cors", "PolicyName" }));
 
 DefaultFilesOptions defaultFilesOptions = new DefaultFilesOptions();
 defaultFilesOptions.DefaultFileNames.Clear();

--
Gitblit v1.9.3