(update)完善登录时抛出的异常信息提示

yun-zuoyi
nies 3 years ago
parent 4653038550
commit b221382cd2

@ -413,7 +413,16 @@ public class WhiteController extends CoreBaseController {
} catch (AuthenticationException e) {
// 系统异常
result = ResultBean.fail(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD.getDescription()).setCode(ImppExceptionEnum.LOGIN_EXCEPTION_USER_PASSWORD.getCode());
result.setErrorMsg(e.getMessage());
if (e.getCause() != null) {
if (e.getCause() instanceof ImppBusiException) {
ImppBusiException imppBusiException = (ImppBusiException) e.getCause();
result.setErrorMsg(LocaleUtils.getLocaleRes(imppBusiException.getErrorDetail()));
}else {
result.setErrorMsg(e.getCause().getMessage());
}
} else {
result.setErrorMsg(e.getMessage());
}
userLoginStatus = CommonEnumUtil.USER_LOGIN_STATUS.SYSTEM_ERROR;
LOGGER.warn("Impp业务异常AuthenticationException 登录失败 ", e);
} catch (ImppBusiException e) {

@ -19,6 +19,8 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import javax.naming.NamingException;
@ -493,9 +495,9 @@ public class SysUserPasswordUtil {
int day = TimeTool.getSecoundsBetweenTime(4, user.getUserLoginLastDateTime(), TimeTool.getNowTime(true));
if(day > loginDayMax){
// 锁定账号信息
//todo: 账户没有被锁定,由于异常事务回滚,导致账户没有被锁定,这个更新操作就是多余的
userService.doLockSysUserById(user.getId());
// 刷新上次登录的时间及次数
userService.refreshUserLoginInformation(user.getId());
throw ImppExceptionBuilder.newInstance()
.setSystemID(CommonEnumUtil.SOFT_TYPE.CORE.getCode())
.setErrorCode(ImppExceptionEnum.NOT_CONFIG_EXCEPTION.getCode())

Loading…
Cancel
Save