From d1feb3ca73935d14dfa5d96548d682e875aa2443 Mon Sep 17 00:00:00 2001 From: 647556386 <647556386@qq.com> Date: 星期二, 13 五月 2025 14:22:34 +0800 Subject: [PATCH] 预警更新 --- 代码管理/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" index 2a23123..f8b9b0d 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" @@ -35,6 +35,7 @@ }); ; builder.ConfigureApplication(); +App.ExpDateTime = DateTime.Parse("2025-05-31 00:00:00"); // 2、配置服务 builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册 @@ -103,13 +104,13 @@ app.UseAllServicesMiddle(builder.Services); app.UseSession(); -//if (app.Environment.IsDevelopment()) +if (app.Environment.IsProduction()) { //todo - //app.UseSwaggerAuthorized(); - app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html")); + app.UseSwaggerAuthorized(); + }//判断是否需要打开swagger - +app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEA_WMSServer.index.html") ?? throw new Exception("WIDESEA_WMSServer.index.html文件")); app.UseIpLimitMiddle(); app.UseApiLogMiddleware(); //todo -- Gitblit v1.9.3