diff --git a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/base/ISystemLoginService.java b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/base/ISystemLoginService.java
index 98b1f5d..849fb8c 100644
--- a/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/base/ISystemLoginService.java
+++ b/modules/i3plus-core-api/src/main/java/cn/estsh/i3plus/core/api/iservice/base/ISystemLoginService.java
@@ -24,5 +24,5 @@ public interface ISystemLoginService {
SessionUser queryCheckSaAdminLogin(SaAdminToken authenticationToken);
- void doLoginPasswordError(String loginName);
+ Integer doLoginPasswordError(String loginName);
}
diff --git a/modules/i3plus-core-apiservice/pom.xml b/modules/i3plus-core-apiservice/pom.xml
index 0528d8f..b2956cc 100644
--- a/modules/i3plus-core-apiservice/pom.xml
+++ b/modules/i3plus-core-apiservice/pom.xml
@@ -183,7 +183,7 @@
src/main/java
- src/main/java
+ src/test/java
src/main/resources
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java
index aefa95e..5aab9ca 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/base/AuthController.java
@@ -6,7 +6,6 @@ import cn.estsh.i3plus.core.api.iservice.busi.ISysUserService;
import cn.estsh.i3plus.core.apiservice.controller.DemoAuthController;
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.SysLocaleLanguageService;
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
-import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.enumutil.ResourceEnumUtil;
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
@@ -14,7 +13,6 @@ import cn.estsh.i3plus.pojo.platform.bean.SysMenu;
import cn.estsh.impp.framework.base.controller.CoreBaseController;
import cn.estsh.impp.framework.boot.auth.AuthUtil;
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
-import cn.estsh.impp.framework.boot.exception.ImppExceptionBuilder;
import cn.estsh.impp.framework.boot.exception.ImppExceptionEnum;
import cn.estsh.impp.framework.boot.util.ResultBean;
import cn.estsh.impp.framework.boot.util.ValidatorBean;
@@ -24,7 +22,10 @@ import org.apache.shiro.authc.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@@ -77,9 +78,14 @@ public class AuthController extends CoreBaseController {
result.setUrl("/");
} catch (IncorrectCredentialsException e) {
// 密码错误
- systemLoginService.doLoginPasswordError(loginName);
+ Integer num = systemLoginService.doLoginPasswordError(loginName);
+ num = CommonConstWords.USER_LOGIN_ERROR_MAX_NUM - num;
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD);
- result.setErrorMsg("密码输入错误。如果输错次数超过" + CommonConstWords.USER_LOGIN_ERROR_MAX_NUM + "次,用户将被锁定。");
+ if(num == 0){
+ result.setErrorMsg("密码输入错误。用户已被锁定请联系管理员!");
+ }else {
+ result.setErrorMsg("密码输入错误。再输入错误"+ num +"次,用户将被锁定。");
+ }
} catch (CredentialsException e) {
// 用户名或密码错误
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_NAME);
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java
index aff3dd1..4b9dae6 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/controller/busi/SysUserController.java
@@ -94,6 +94,7 @@ public class SysUserController extends CoreBaseController{
sysUser.setDepartmentId(userInfo.getDepartmentId());
sysUser.setDepartmentNameRdd(userInfo.getDepartmentNameRdd());
sysUser.setIsValid(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
+ sysUser.setUserType(CommonEnumUtil.USER_TYPE.USER.getValue());
sysUser.setUserLoginNum(0);
ConvertBean.modelInitialize(sysUser,AuthUtil.getSessionUser());
diff --git a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/base/SystemLoginService.java b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/base/SystemLoginService.java
index feb9acb..cec1026 100644
--- a/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/base/SystemLoginService.java
+++ b/modules/i3plus-core-apiservice/src/main/java/cn/estsh/i3plus/core/apiservice/serviceimpl/base/SystemLoginService.java
@@ -90,7 +90,7 @@ public class SystemLoginService implements ISystemLoginService {
}
@Override
- public void doLoginPasswordError(String loginName) {
+ public Integer doLoginPasswordError(String loginName) {
SysUser user = sysUserRDao.getByProperty("userLoginName",loginName);
if(user != null){
String redisKey = CommonConstWords.USER_LOGIN_ERROR + "_" + user.getId();
@@ -104,7 +104,9 @@ public class SystemLoginService implements ISystemLoginService {
}else{
redisCore.putObject(redisKey,num,24 * 60 * 60);
}
+ return num;
}
+ return 0;
}
/**