From b057f9985a360fcfeb3aa6e96eae99deccffa1d2 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期三, 23 六月 2021 14:31:43 +0800
Subject: [PATCH] 特殊群人上报接口,获取系统配置接口
---
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java
index 3fac57d..7bc3abe 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java
@@ -2,6 +2,7 @@
import com.panzhihua.common.utlis.ResultUtil;
import com.panzhihua.common.model.vos.R;
+import lombok.extern.slf4j.Slf4j;
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.core.AuthenticationException;
@@ -18,6 +19,8 @@
* @author: huang.hongfa weixin hhf9596 qq 959656820
* @create: 2020-11-24 16:02
**/
+@Slf4j
+@Component
public class UserLoginFailureHandler implements AuthenticationFailureHandler {
/**
* 登录失败返回结果
@@ -25,9 +28,10 @@
*/
@Override
public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception){
+ log.info("登录失败");
// 这些对于操作的处理类可以根据不同异常进行不同处理
if (exception instanceof UsernameNotFoundException){
- ResultUtil.responseJson(response, R.fail("用户名不存在"));
+ ResultUtil.responseJson(response, R.fail("该账号不存在"));
}
if (exception instanceof LockedException){
ResultUtil.responseJson(response,R.fail("用户被冻结"));
--
Gitblit v1.7.1