|
|
@ -89,6 +89,18 @@ public class SysLoginService |
|
|
LoginUser userInfo = userResult.getData(); |
|
|
LoginUser userInfo = userResult.getData(); |
|
|
SysUser user = userResult.getData().getSysUser(); |
|
|
SysUser user = userResult.getData().getSysUser(); |
|
|
|
|
|
|
|
|
|
|
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
|
|
|
|
|
{ |
|
|
|
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); |
|
|
|
|
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); |
|
|
|
|
|
} |
|
|
|
|
|
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
|
|
|
|
|
{ |
|
|
|
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); |
|
|
|
|
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
|
|
|
|
|
} |
|
|
|
|
|
passwordService.validate(user, password); |
|
|
|
|
|
|
|
|
if (!soloLogin) |
|
|
if (!soloLogin) |
|
|
{ |
|
|
{ |
|
|
// 如果用户不允许多终端同时登录,清除缓存信息 |
|
|
// 如果用户不允许多终端同时登录,清除缓存信息 |
|
|
@ -105,17 +117,6 @@ public class SysLoginService |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
|
|
|
|
|
{ |
|
|
|
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "对不起,您的账号已被删除"); |
|
|
|
|
|
throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); |
|
|
|
|
|
} |
|
|
|
|
|
if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
|
|
|
|
|
{ |
|
|
|
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_FAIL, "用户已停用,请联系管理员"); |
|
|
|
|
|
throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
|
|
|
|
|
} |
|
|
|
|
|
passwordService.validate(user, password); |
|
|
|
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功"); |
|
|
recordLogService.recordLogininfor(username, Constants.LOGIN_SUCCESS, "登录成功"); |
|
|
recordLoginInfo(user.getUserId()); |
|
|
recordLoginInfo(user.getUserId()); |
|
|
return userInfo; |
|
|
return userInfo; |
|
|
|