| | |
| | | package com.ruoyi.auth.service; |
| | | |
| | | import com.ruoyi.system.api.RemoteUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | import com.ruoyi.common.core.constant.CacheConstants; |
| | |
| | | import com.ruoyi.system.api.domain.SysUser; |
| | | import com.ruoyi.system.api.model.LoginUser; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | |
| | | /** |
| | |
| | | */ |
| | | @Component |
| | | public class SysLoginService { |
| | | @Autowired |
| | | @Resource |
| | | private RemoteUserService remoteUserService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private SysPasswordService passwordService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private SysRecordLogService recordLogService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | /** |
| | |
| | | } |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您的账号已被禁用,请联系平台"); |
| | | } |
| | | passwordService.validate(user, password, request); |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |