From d7b3ebb1ce279327b3bf61c87e624662c77ec962 Mon Sep 17 00:00:00 2001 From: yubaolee Date: Wed, 10 Sep 2025 17:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A0=EF=B8=8Ffeat:=20=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8E=BB=E6=8E=89swagger=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.WebApi/Startup.cs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/OpenAuth.WebApi/Startup.cs b/OpenAuth.WebApi/Startup.cs index c7eedc08..c5d8e320 100644 --- a/OpenAuth.WebApi/Startup.cs +++ b/OpenAuth.WebApi/Startup.cs @@ -241,13 +241,6 @@ namespace OpenAuth.WebApi { loggerFactory.AddLog4Net(); - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseMiniProfiler(); - //可以访问根目录下面的静态文件 var staticfile = new StaticFileOptions { @@ -276,9 +269,15 @@ namespace OpenAuth.WebApi //配置ServiceProvider 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.), // specifying the Swagger JSON endpoint.