|
|
@ -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.controller.DemoAuthController;
|
|
|
|
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.SysLocaleLanguageService;
|
|
|
|
import cn.estsh.i3plus.core.apiservice.serviceimpl.busi.SysLocaleLanguageService;
|
|
|
|
import cn.estsh.i3plus.platform.common.util.CommonConstWords;
|
|
|
|
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.base.enumutil.ResourceEnumUtil;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SessionUser;
|
|
|
|
import cn.estsh.i3plus.pojo.platform.bean.SysLocaleLanguage;
|
|
|
|
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.base.controller.CoreBaseController;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.auth.AuthUtil;
|
|
|
|
import cn.estsh.impp.framework.boot.exception.ImppBusiException;
|
|
|
|
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.exception.ImppExceptionEnum;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ResultBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
|
import cn.estsh.impp.framework.boot.util.ValidatorBean;
|
|
|
@ -24,7 +22,10 @@ import org.apache.shiro.authc.*;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.Logger;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
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 javax.servlet.http.HttpServletRequest;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
@ -77,9 +78,14 @@ public class AuthController extends CoreBaseController {
|
|
|
|
result.setUrl("/");
|
|
|
|
result.setUrl("/");
|
|
|
|
} catch (IncorrectCredentialsException e) {
|
|
|
|
} 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 = 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) {
|
|
|
|
} catch (CredentialsException e) {
|
|
|
|
// 用户名或密码错误
|
|
|
|
// 用户名或密码错误
|
|
|
|
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_NAME);
|
|
|
|
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_NAME);
|
|
|
|