🐛 fix a bug #I1H24Z 统一登录错误信息乱码

This commit is contained in:
卓广飞 2020-05-13 16:15:56 +08:00 committed by Gitee
parent 7dc9dc01bc
commit 3162c7325c
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}