⚠️feat: 正式环境去掉swagger界面

This commit is contained in:
yubaolee
2025-09-10 17:30:45 +08:00
parent 217b407cd9
commit d7b3ebb1ce

View File

@@ -241,13 +241,6 @@ namespace OpenAuth.WebApi
{ {
loggerFactory.AddLog4Net(); loggerFactory.AddLog4Net();
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseMiniProfiler();
//可以访问根目录下面的静态文件 //可以访问根目录下面的静态文件
var staticfile = new StaticFileOptions var staticfile = new StaticFileOptions
{ {
@@ -277,8 +270,14 @@ namespace OpenAuth.WebApi
//配置ServiceProvider //配置ServiceProvider
AutofacContainerModule.ConfigServiceProvider(app.ApplicationServices); AutofacContainerModule.ConfigServiceProvider(app.ApplicationServices);
if (env.IsDevelopment())
{
app.UseMiniProfiler();
app.UseDeveloperExceptionPage();
app.UseSwagger(); app.UseSwagger();
}
// Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.), // Enable middleware to serve swagger-ui (HTML, JS, CSS, etc.),
// specifying the Swagger JSON endpoint. // specifying the Swagger JSON endpoint.