From 33f713d17d59874d9f78ebc284fa1e9fe35ed3e1 Mon Sep 17 00:00:00 2001 From: qraddx Date: Tue, 15 Mar 2022 09:39:10 +0800 Subject: [PATCH] =?UTF-8?q?:beers:=20close=20#3705=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E8=A2=AB=E9=94=81=E5=AE=9A=E6=97=B6=EF=BC=8C=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E7=94=A8=E6=88=B7=E5=B8=90=E5=8F=B7=E5=B7=B2?= =?UTF-8?q?=E8=A2=AB=E9=94=81=E5=AE=9A=EF=BC=8C=E8=AF=B7=E6=B1=82=E8=BF=94?= =?UTF-8?q?=E5=9B=9E=E7=94=A8=E6=88=B7=E5=90=8D=E4=B8=8D=E5=AD=98=E5=9C=A8?= =?UTF-8?q?=E6=88=96=E8=80=85=E5=AF=86=E7=A0=81=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../component/PigxWebResponseExceptionTranslator.java | 7 +------ 1 file changed, 1 insertion(+), 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 a2a8755be..1f8bb45a2 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 @@ -18,7 +18,6 @@ package com.pig4cloud.pigx.common.security.component; import com.pig4cloud.pigx.common.security.exception.*; -import com.pig4cloud.pigx.common.security.util.PigxSecurityMessageSourceUtil; import lombok.extern.slf4j.Slf4j; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; @@ -33,8 +32,6 @@ import org.springframework.security.oauth2.provider.error.WebResponseExceptionTr import org.springframework.security.web.util.ThrowableAnalyzer; import org.springframework.web.HttpRequestMethodNotSupportedException; -import java.util.Locale; - /** * @author lengleng * @date 2020-06-20 OAutH Server 异常处理,重写oauth 默认实现 @@ -65,9 +62,7 @@ public class PigxWebResponseExceptionTranslator implements WebResponseExceptionT ase = (InvalidGrantException) throwableAnalyzer.getFirstThrowableOfType(InvalidGrantException.class, causeChain); if (ase != null) { - String msg = PigxSecurityMessageSourceUtil.getAccessor().getMessage( - "AbstractUserDetailsAuthenticationProvider.badCredentials", ase.getMessage(), Locale.CHINA); - return handleOAuth2Exception(new InvalidException(msg, ase)); + return handleOAuth2Exception(new InvalidException(ase.getLocalizedMessage(), ase)); } ase = (HttpRequestMethodNotSupportedException) throwableAnalyzer