From 41a5531dc31a642623f0a7a766fbe9c256ba9247 Mon Sep 17 00:00:00 2001
From: dengjunjie <dengjunjie@hnkhzn.com>
Date: 星期二, 11 二月 2025 13:53:29 +0800
Subject: [PATCH] 优化WMS前端
---
项目代码/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
index 80e6a5f..bd31b39 100644
--- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
+++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSServer/WIDESEA_WMSServer/Program.cs"
@@ -34,13 +34,14 @@
}); ;
builder.ConfigureApplication();
+App.ExpDateTime = DateTime.Parse("2025-06-30 00:00:00");
// 2、配置服务
builder.Services.AddSingleton(new AppSettings(builder.Configuration));//注册
builder.Services.AddAllOptionRegister();//读取配置文件
builder.Services.AddMemoryCacheSetup();//缓存
builder.Services.AddSqlsugarSetup();//SqlSugar 启动服务
-//builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
+builder.Services.AddInitializationHostServiceSetup();//应用初始化服务注入
builder.Services.AddDbSetup();//Db 启动服务
builder.Services.AddAutoMapperSetup();
@@ -96,14 +97,16 @@
app.UseMiniProfiler();//性能分析器
app.ConfigureApplication();//配置文件
app.UseApplicationSetup();//启动配置
+
+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