| | |
| | | // if (user==null){ |
| | | // r |
| | | // } |
| | | // if (StringUtils.isNull(user)){ |
| | | // log.info("登录用户:{} 不存在.", username); |
| | | // throw new ServiceException(MessageUtils.message("user.not.exists")); |
| | | // } else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) { |
| | | // log.info("登录用户:{} 已被删除.", username); |
| | | // throw new ServiceException(MessageUtils.message("user.password.delete")); |
| | | // } else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | // log.info("登录用户:{} 已被停用.", username); |
| | | // throw new ServiceException(MessageUtils.message("user.blocked")); |
| | | // } |
| | | if (StringUtils.isNull(user)){ |
| | | log.info("登录用户:{} 不存在.", username); |
| | | throw new ServiceException("登录用户不存在"); |
| | | } else if (user.getIsDelete()) { |
| | | log.info("登录用户:{} 已被删除.", username); |
| | | throw new ServiceException("登录用户已被删除"); |
| | | } else if (user.getStatus() == 2) { |
| | | log.info("登录用户:{} 已被停用.", username); |
| | | throw new ServiceException("登录用户已被冻结"); |
| | | }else if (user.getStatus() == 3) { |
| | | log.info("登录用户:{} 已被注销.", username); |
| | | throw new ServiceException("登录用户已被注销"); |
| | | } |
| | | try |
| | | { |
| | | UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(username, null); |