From 6d5c3dee0d97798f70bf965e48c3a782b3df9e7d Mon Sep 17 00:00:00 2001
From: bklLiudl <673013083@qq.com>
Date: 星期三, 10 七月 2024 10:48:25 +0800
Subject: [PATCH] Merge branch 'hwh' into Liudl

---
 Wms/Wms/Startup.cs |   20 ++++++++++++--------
 1 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/Wms/Wms/Startup.cs b/Wms/Wms/Startup.cs
index fb30816..694afba 100644
--- a/Wms/Wms/Startup.cs
+++ b/Wms/Wms/Startup.cs
@@ -43,9 +43,10 @@
             var url2 = Configuration.GetSection("ApiUrlConfig:AgvHost").Value + Configuration.GetSection("ApiUrlConfig:IssueComApiUrl").Value;
             //调用定时任务
             services.AddHostedService<DailyTaskService>(provider =>
-            new DailyTaskService(url,url2));
+            new DailyTaskService(url, url2));
 
-            services.AddControllers(options => {
+            services.AddControllers(options =>
+            {
                 options.Filters.Add<RequestAuditLogFilter>();
             })
                 .AddJsonOptions(options =>
@@ -91,7 +92,7 @@
                             .SetIsOriginAllowed(_ => true)
                             .AllowAnyHeader()
                             .AllowCredentials();
-                            
+
                     });
             });
             #endregion
@@ -110,13 +111,13 @@
             #endregion
 
             //读取配置文件配置的接口交互的相关配置
-            services.Configure<ApiUrlConfig>(Configuration.GetSection("ApiUrlConfig")); 
+            services.Configure<ApiUrlConfig>(Configuration.GetSection("ApiUrlConfig"));
             //数据库配置
             BaseDbConfig.ConnectionString = Configuration.GetSection("AppSettings:ConnectionString").Value;
             //验签配置文件
-            SignConfig.ERPAppKey = Configuration.GetSection("SignConfig:ERPAppKey").Value;  
-            SignConfig.MESAppKey = Configuration.GetSection("SignConfig:MESAppKey").Value;  
-            SignConfig.LIMSAppKey = Configuration.GetSection("SignConfig:LIMSAppKey").Value;  
+            SignConfig.ERPAppKey = Configuration.GetSection("SignConfig:ERPAppKey").Value;
+            SignConfig.MESAppKey = Configuration.GetSection("SignConfig:MESAppKey").Value;
+            SignConfig.LIMSAppKey = Configuration.GetSection("SignConfig:LIMSAppKey").Value;
             SignConfig.FuMaAppKey = Configuration.GetSection("SignConfig:FuMaAppKey").Value;
             SignConfig.Minutes = double.Parse(Configuration.GetSection("SignConfig:Minutes").Value);
 
@@ -135,6 +136,9 @@
 
             services.AddHostedService<HostedService>();
             services.AddSingleton<SchedulerCenter>();
+
+            services.AddTransient<UserManager>();
+            services.AddTransient<IHttpContextAccessor, HttpContextAccessor>();
         }
         public void ConfigureContainer(ContainerBuilder builder)
         {
@@ -167,7 +171,7 @@
             //app.UseHttpsRedirection();
 
             app.UseRouting();
-            
+
             app.UseAuthentication();
             app.UseAuthorization();
             app.UseCors("MyCors");//跨域

--
Gitblit v1.8.0