z8018
2025-08-26 0b275760ee275562439c91e473e731a82c836b57
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();