From 94e3a209bb9a31c4ddbd31494bb1628f6fe2e96e Mon Sep 17 00:00:00 2001
From: lidongdong <1459917685@qq.com>
Date: 星期三, 12 十月 2022 17:54:49 +0800
Subject: [PATCH] 新增首页工单 办事指南排行榜接口 导办人员排行榜接口 组织排行榜接口 新增办事指南统计接口 导办人员统计接口 组织胖行榜统计接口
---
springcloud_k8s_panzhihuazhihuishequ/auth/src/main/java/com/panzhihua/auth/handel/UserLoginFailureHandler.java | 30 +++++++++++++++++-------------
1 files changed, 17 insertions(+), 13 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 2b561f6..9d4d685 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
@@ -1,8 +1,8 @@
package com.panzhihua.auth.handel;
-import com.panzhihua.common.utlis.ResultUtil;
-import com.panzhihua.common.model.vos.R;
-import lombok.extern.slf4j.Slf4j;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.LockedException;
import org.springframework.security.core.AuthenticationException;
@@ -10,8 +10,10 @@
import org.springframework.security.web.authentication.AuthenticationFailureHandler;
import org.springframework.stereotype.Component;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
+import com.panzhihua.common.model.vos.R;
+import com.panzhihua.common.utlis.ResultUtil;
+
+import lombok.extern.slf4j.Slf4j;
/**
* @program: springcloud_k8s_panzhihuazhihuishequ
@@ -24,21 +26,23 @@
public class UserLoginFailureHandler implements AuthenticationFailureHandler {
/**
* 登录失败返回结果
+ *
* @Author youcong
*/
@Override
- public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response, AuthenticationException exception){
+ public void onAuthenticationFailure(HttpServletRequest request, HttpServletResponse response,
+ AuthenticationException exception) {
log.info("登录失败");
// 这些对于操作的处理类可以根据不同异常进行不同处理
- if (exception instanceof UsernameNotFoundException){
- ResultUtil.responseJson(response, R.fail("用户名不存在"));
+ if (exception instanceof UsernameNotFoundException) {
+ ResultUtil.responseJson(response, R.fail("该账号不存在"));
}
- if (exception instanceof LockedException){
- ResultUtil.responseJson(response,R.fail("用户被冻结"));
+ if (exception instanceof LockedException) {
+ ResultUtil.responseJson(response, R.fail("用户被冻结"));
}
- if (exception instanceof BadCredentialsException){
- ResultUtil.responseJson(response,R.fail("密码错误"));
+ if (exception instanceof BadCredentialsException) {
+ ResultUtil.responseJson(response, R.fail("密码错误"));
}
- ResultUtil.responseJson(response,R.fail("登录失败"));
+ ResultUtil.responseJson(response, R.fail("登录失败"));
}
}
--
Gitblit v1.7.1