diff --git a/24Hour/24Hour.csproj b/24Hour/24Hour.csproj index 9bde41e..8d1cbda 100644 --- a/24Hour/24Hour.csproj +++ b/24Hour/24Hour.csproj @@ -8,8 +8,8 @@ True e485308c-2f05-470b-b0a4-68f1ec2b3412 Linux - 1.0.2.7 - 1.0.2.7 + 1.0.3.1 + 1.0.3.1 diff --git a/24Hour/Program.cs b/24Hour/Program.cs index 9c6b24b..7d64b52 100644 --- a/24Hour/Program.cs +++ b/24Hour/Program.cs @@ -268,8 +268,13 @@ var app = builder.Build(); // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { - app.UseSwagger(); - app.UseSwaggerUI(); + app.UseSwagger();// 启用Swagger中间件 + app.UseSwaggerUI(c => + { + c.SwaggerEndpoint("/swagger/v1/swagger.json", "24小时一体机 API V1"); + c.RoutePrefix = string.Empty; + + }); } #region websockets配置 app.UseWebSockets(new WebSocketOptions @@ -293,15 +298,6 @@ app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); -#region swagger -app.UseSwagger();// 启用Swagger中间件 -app.UseSwaggerUI(c => -{ - c.SwaggerEndpoint("/swagger/v1/swagger.json", "24小时一体机 API V1"); - c.RoutePrefix = string.Empty; - -}); -#endregion app.UseCors("CorsPolicy"); app.Run();