| | |
| | | // 查询用户信息 |
| | | SysUser user = userService.selectUserByUserName(username); |
| | | if (StringUtils.isNull(user)) { |
| | | throw new ServiceException("登录失败,请稍后重试", I18nKeyConstant.LOGIN_FAIL); |
| | | throw new ServiceException("帐号不存在或已被删除", I18nKeyConstant.ACCOUNT_NOT_EXISTS); |
| | | } |
| | | // 角色集合 |
| | | Set<String> roles = permissionService.getRolePermission(user); |
| | |
| | | recordLogService.recordLogininfor(request, user.getId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "对不起,您的账号已被删除"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | if (Integer.valueOf("1").equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您的账号:" + username + " 已禁用", I18nKeyConstant.LOGIN_ACCOUNT_DISABLED); |
| | | } |
| | | passwordService.validate(user, password, request); |
| | | // recordLogService.recordLogininfor(request, user.getId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |