From e5469fcd983c9f46d15a40ad5e27cf96e5d72a3a Mon Sep 17 00:00:00 2001 From: lbw Date: Thu, 5 Aug 2021 10:37:27 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20Introducing=20new=20features.=20cl?= =?UTF-8?q?osed=20#3013=20=E3=80=90=E9=87=8D=E6=9E=84=E3=80=91=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E5=89=8D=E7=AB=AFindex.vue=20=E7=9A=84=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=80=BB=E8=BE=91=E6=8A=BD=E5=8F=96=E6=88=90=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=9A=84=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PigxWebResponseExceptionTranslator.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxWebResponseExceptionTranslator.java b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxWebResponseExceptionTranslator.java index c279f338a..857d55cf1 100644 --- a/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxWebResponseExceptionTranslator.java +++ b/pigx-common/pigx-common-security/src/main/java/com/pig4cloud/pigx/common/security/component/PigxWebResponseExceptionTranslator.java @@ -76,12 +76,6 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT return handleOAuth2Exception(new MethodNotAllowedException(ase.getMessage(), ase)); } - ase = (OAuth2Exception) throwableAnalyzer.getFirstThrowableOfType(OAuth2Exception.class, causeChain); - - if (ase != null) { - return handleOAuth2Exception((OAuth2Exception) ase); - } - // 处理不合法的令牌错误 401 返回 ase = (InvalidTokenException) throwableAnalyzer.getFirstThrowableOfType(InvalidTokenException.class, causeChain); @@ -89,6 +83,12 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT return handleOAuth2Exception(new UnauthorizedException(ase.getMessage(), ase)); } + ase = (OAuth2Exception) throwableAnalyzer.getFirstThrowableOfType(OAuth2Exception.class, causeChain); + + if (ase != null) { + return handleOAuth2Exception((OAuth2Exception) ase); + } + return handleOAuth2Exception(new ServerErrorException(HttpStatus.INTERNAL_SERVER_ERROR.getReasonPhrase(), e)); }