From 655e3454a3a7a086b00fb527110c500628b703b4 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Fri, 6 Dec 2024 16:20:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.API/Startup.cs | 2 +- IRaCIS.Core.API/_ServiceExtensions/Swagger/SwaggerSetup.cs | 1 + IRaCIS.Core.Application/Middleware/AuthenticationMiddleware.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.API/Startup.cs b/IRaCIS.Core.API/Startup.cs index 3db4baf..1fd1dc5 100644 --- a/IRaCIS.Core.API/Startup.cs +++ b/IRaCIS.Core.API/Startup.cs @@ -204,7 +204,7 @@ namespace IRaCIS.Core.API // 特殊异常处理 比如 404 app.UseStatusCodePagesWithReExecute("/Error/{0}"); - SwaggerSetup.Configure(app, env); + //SwaggerSetup.Configure(app, env); diff --git a/IRaCIS.Core.API/_ServiceExtensions/Swagger/SwaggerSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/Swagger/SwaggerSetup.cs index 68905d6..38a716f 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/Swagger/SwaggerSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/Swagger/SwaggerSetup.cs @@ -4,6 +4,7 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; using Microsoft.OpenApi.Models; +using NPOI.SS.Formula.Functions; using Swashbuckle.AspNetCore.Filters; using Swashbuckle.AspNetCore.SwaggerGen; using Swashbuckle.AspNetCore.SwaggerUI; diff --git a/IRaCIS.Core.Application/Middleware/AuthenticationMiddleware.cs b/IRaCIS.Core.Application/Middleware/AuthenticationMiddleware.cs index 0fdf5cb..525588f 100644 --- a/IRaCIS.Core.Application/Middleware/AuthenticationMiddleware.cs +++ b/IRaCIS.Core.Application/Middleware/AuthenticationMiddleware.cs @@ -33,7 +33,7 @@ namespace IRaCIS.Core.API.Middleware { context.Response.StatusCode = StatusCodes.Status409Conflict; ; context.Response.ContentType = "application/json"; - var msg = JsonConvert.SerializeObject(ResponseOutput.NotOk("You do not have permission")); + var msg = JsonConvert.SerializeObject(ResponseOutput.NotOk("Access was denied due to lack of permission")); Console.WriteLine(msg); await context.Response.WriteAsync(msg); await context.Response.Body.FlushAsync();