新增 swaggerui 开发环境条件限制

This commit is contained in:
小肥羊 2025-07-08 10:11:04 +08:00
parent 8c4ecac249
commit eab1d9e653
1 changed files with 4 additions and 5 deletions

View File

@ -48,12 +48,11 @@ namespace Learn.VideoAnalysis.API
var app = builder.Build(); var app = builder.Build();
AppCommon.Services = app.Services; AppCommon.Services = app.Services;
app.UseMiddleware<BasicAuthMiddleware>("Swagger");
// Configure the HTTP request pipeline. // Configure the HTTP request pipeline.
if (app.Environment.IsDevelopment())
{ app.UseSwagger();
app.UseSwagger(); app.UseSwaggerUI();
app.UseSwaggerUI();
}
app.UseHttpsRedirection(); app.UseHttpsRedirection();