1
hutongqing
2025-01-15 baf2e27842ba7a0176ab4842377e721249966c9e
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Server/Program.cs
@@ -51,6 +51,8 @@
builder.Services.AddHostedService<WarehouseHostedService>();
builder.Services.AddHostedService<QuartzJobDataTableHostedService>();
builder.Services.AddWebSocketSetup();
builder.Services.AddAutoMapperSetup();
builder.Services.AddCorsSetup();
@@ -112,13 +114,15 @@
app.UseAllServicesMiddle(builder.Services);
app.UseSession();
//if (app.Environment.IsDevelopment())
if (app.Environment.IsProduction())
{
    //todo
    app.UseSwaggerAuthorized();
    app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html") ?? throw new Exception("未找到WIDESEAWCS_Server.index.html文件"));
}//判断是否需要打开swagger
app.UseSwaggerMiddle(() => Assembly.GetExecutingAssembly().GetManifestResourceStream("WIDESEAWCS_Server.index.html") ?? throw new Exception("未找到WIDESEAWCS_Server.index.html文件"));
app.UseIpLimitMiddle();
app.UseApiLogMiddleware();
//todo