| | |
| | | // 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 => |
| | | { |
| | |
| | | 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注入 |
| | |
| | | app.UseAuthentication(); |
| | | app.UseAuthorization(); |
| | | app.UseCors("MyCors");//跨域 |
| | | |
| | | //发布后展示页面 |
| | | app.UseDefaultFiles(); |
| | | app.UseStaticFiles(); |
| | | |
| | | app.UseEndpoints(endpoints => |
| | | { |