|
|
@ -12,6 +12,7 @@ using DS.Module.SqlSugar;
|
|
|
|
using DS.Module.Swagger;
|
|
|
|
using DS.Module.Swagger;
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
using DS.Module.UserModule;
|
|
|
|
using NLog.Web;
|
|
|
|
using NLog.Web;
|
|
|
|
|
|
|
|
using DS.WMS.Core.HangfireJob.Method;
|
|
|
|
|
|
|
|
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
var builder = WebApplication.CreateBuilder(args);
|
|
|
|
var environment = builder.Environment.EnvironmentName;
|
|
|
|
var environment = builder.Environment.EnvironmentName;
|
|
|
@ -24,7 +25,7 @@ builder.Configuration
|
|
|
|
.Build();
|
|
|
|
.Build();
|
|
|
|
builder.Configuration.AddEnvironmentVariables();
|
|
|
|
builder.Configuration.AddEnvironmentVariables();
|
|
|
|
builder.Logging.AddNLog("nlog.config");
|
|
|
|
builder.Logging.AddNLog("nlog.config");
|
|
|
|
// Add services to the container.
|
|
|
|
|
|
|
|
//Autofac×¢Èë
|
|
|
|
//Autofac×¢Èë
|
|
|
|
builder.Host
|
|
|
|
builder.Host
|
|
|
|
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
|
|
|
.UseServiceProviderFactory(new AutofacServiceProviderFactory())
|
|
|
@ -49,35 +50,7 @@ builder.Services.AddRuleEngineModuleInstall();//Djy
|
|
|
|
var app = builder.Build();
|
|
|
|
var app = builder.Build();
|
|
|
|
|
|
|
|
|
|
|
|
app.UsePublicMiddlewares();
|
|
|
|
app.UsePublicMiddlewares();
|
|
|
|
//var documentName = AppSetting.app(new string[] { "SwaggerDoc", "ContactName" });
|
|
|
|
|
|
|
|
//app
|
|
|
|
|
|
|
|
// .UseSwagger(c => { c.RouteTemplate = "{documentName}/swagger.json"; })
|
|
|
|
|
|
|
|
// .UseSwaggerUI(c =>
|
|
|
|
|
|
|
|
// {
|
|
|
|
|
|
|
|
// c.SwaggerEndpoint("/" + documentName + "/swagger.json",
|
|
|
|
|
|
|
|
// AppSetting.app(new string[] { "SwaggerDoc", "ContactName" }));
|
|
|
|
|
|
|
|
// c.DocExpansion(DocExpansion.None);//DocExpansion设置为None可折叠所有方法
|
|
|
|
|
|
|
|
// c.DefaultModelExpandDepth(-1);//-1 可不显示Models
|
|
|
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
////跨域
|
|
|
|
|
|
|
|
//var policyName = AppSetting.app(new string[] { "Cors", "PolicyName" });
|
|
|
|
|
|
|
|
//if (!policyName.IsNullOrEmpty())
|
|
|
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
// app.UseCors(policyName); //添加跨域中间件
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//app.UseRouting();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//app.UseStaticFiles();
|
|
|
|
|
|
|
|
////多语言中间件
|
|
|
|
|
|
|
|
//app.UseMiddleware<MultiLanguageMiddleware>();
|
|
|
|
|
|
|
|
//// //操作日志中间件
|
|
|
|
|
|
|
|
//// app.UseMiddleware<OperationLogMiddleware>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// 先开启认证
|
|
|
|
app.UseJobMiddlewares();
|
|
|
|
//app.UseAuthentication();
|
|
|
|
|
|
|
|
//// 然后是授权中间件
|
|
|
|
|
|
|
|
//app.UseAuthorization();
|
|
|
|
|
|
|
|
//app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app.Run();
|
|
|
|
app.Run();
|