From 3162c7325cf187e94a49c6642522d7d524619367 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8D=93=E5=B9=BF=E9=A3=9E?= <7559930+zhuo_guangfei@user.noreply.gitee.com> Date: Wed, 13 May 2020 16:15:56 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20fix=20a=20bug=20=20#I1H24Z=20=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=99=BB=E5=BD=95=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E4=B9=B1=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../security/handler/FormAuthenticationFailureHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java index 36885da2..553a7161 100644 --- a/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java +++ b/pig-common/pig-common-security/src/main/java/com/pig4cloud/pig/common/security/handler/FormAuthenticationFailureHandler.java @@ -47,7 +47,7 @@ public class FormAuthenticationFailureHandler implements AuthenticationFailureHa @SneakyThrows public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception) { log.debug("表单登录失败:{}", exception.getLocalizedMessage()); - response.sendRedirect(String.format("/token/login?error=%s" - , HttpUtil.encodeParams(exception.getMessage(), Charset.defaultCharset()))); + String url = HttpUtil.encodeParams(String.format("/token/login?error=%s", exception.getMessage()), Charset.defaultCharset()); + WebUtils.getResponse().sendRedirect(url); } } -- GitLab