From 4f7b007a9e0de9dac35c8c81e6e32f9ab6fee5c8 Mon Sep 17 00:00:00 2001 From: wxw <Administrator@DESKTOP-5BIMHQ3> Date: 星期四, 26 九月 2024 08:47:29 +0800 Subject: [PATCH] Merge branch 'wxw' --- Wms/Wms/Startup.cs | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/Wms/Wms/Startup.cs b/Wms/Wms/Startup.cs index dbf35ec..3d69d79 100644 --- a/Wms/Wms/Startup.cs +++ b/Wms/Wms/Startup.cs @@ -28,6 +28,9 @@ // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { + //调用定时任务 + services.AddHostedService<DailyTaskService>(); + services.AddControllers() .AddJsonOptions(options => { @@ -94,6 +97,9 @@ services.Configure<ApiUrlConfig>(Configuration.GetSection("ApiUrlConfig")); //数据库配置 BaseDbConfig.ConnectionString = Configuration.GetSection("AppSettings:ConnectionString").Value; + //MES账号密码 + MesConfig.MesUser = Configuration.GetSection("MesConfig:MesUser").Value; + MesConfig.MesPassWord = Configuration.GetSection("MesConfig:MesPassWord").Value; #region AutoMapper注入 @@ -132,7 +138,9 @@ app.UseAuthentication(); app.UseAuthorization(); app.UseCors("MyCors");//跨域 - + //发布后展示页面 + app.UseDefaultFiles(); + app.UseStaticFiles(); app.UseEndpoints(endpoints => { -- Gitblit v1.8.0