From e945cf3dc5ddb5d85877886553cce8360c908594 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Fri, 26 Nov 2021 22:29:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(wrapper):=20=E5=8E=BB=E6=8E=89=E5=8C=85?= =?UTF-8?q?=E8=A3=85=E5=90=8E=E7=9A=84abp=E9=BB=98=E8=AE=A4=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=A0=87=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ExceptionHandling/AbpExceptionPageWrapResultFilter.cs | 4 ++-- .../ExceptionHandling/AbpExceptionWrapResultFilter.cs | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs index 952612e1b..4df387198 100644 --- a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs +++ b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionPageWrapResultFilter.cs @@ -23,9 +23,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling { protected override bool ShouldHandleException(PageHandlerExecutingContext context) { - if (!context.ActionDescriptor.CanWarpRsult()) + if (context.ActionDescriptor.CanWarpRsult()) { - return false; + return true; } return base.ShouldHandleException(context); } diff --git a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs index fc590d414..96c13e746 100644 --- a/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs +++ b/aspnet-core/modules/mvc/LINGYUN.Abp.AspNetCore.Mvc.Wrapper/LINGYUN/Abp/AspNetCore/Mvc/Wrapper/ExceptionHandling/AbpExceptionWrapResultFilter.cs @@ -26,9 +26,9 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling { var wrapResultChecker = context.GetRequiredService(); - if (!wrapResultChecker.WrapOnException(context)) + if (wrapResultChecker.WrapOnException(context)) { - return false; + return true; } return base.ShouldHandleException(context); } @@ -55,7 +55,6 @@ namespace LINGYUN.Abp.AspNetCore.Mvc.Wrapper.ExceptionHandling await context.GetRequiredService().NotifyAsync(new ExceptionNotificationContext(context.Exception)); - context.HttpContext.Response.Headers.Add(AbpHttpConsts.AbpErrorFormat, "true"); context.HttpContext.Response.Headers.Add(AbpHttpWrapConsts.AbpWrapResult, "true"); context.HttpContext.Response.StatusCode = (int)wrapResultOptions.HttpStatusCode;