正在显示
1 个修改的文件
包含
4 行增加
和
3 行删除
| @@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; | @@ -11,6 +11,7 @@ import com.ruoyi.common.core.domain.entity.SysUser; | ||
| 11 | import com.ruoyi.common.core.domain.model.LoginUser; | 11 | import com.ruoyi.common.core.domain.model.LoginUser; |
| 12 | import com.ruoyi.common.enums.UserStatus; | 12 | import com.ruoyi.common.enums.UserStatus; |
| 13 | import com.ruoyi.common.exception.ServiceException; | 13 | import com.ruoyi.common.exception.ServiceException; |
| 14 | +import com.ruoyi.common.utils.MessageUtils; | ||
| 14 | import com.ruoyi.common.utils.StringUtils; | 15 | import com.ruoyi.common.utils.StringUtils; |
| 15 | import com.ruoyi.system.service.ISysUserService; | 16 | import com.ruoyi.system.service.ISysUserService; |
| 16 | 17 | ||
| @@ -40,17 +41,17 @@ public class UserDetailsServiceImpl implements UserDetailsService | @@ -40,17 +41,17 @@ public class UserDetailsServiceImpl implements UserDetailsService | ||
| 40 | if (StringUtils.isNull(user)) | 41 | if (StringUtils.isNull(user)) |
| 41 | { | 42 | { |
| 42 | log.info("登录用户:{} 不存在.", username); | 43 | log.info("登录用户:{} 不存在.", username); |
| 43 | - throw new ServiceException("登录用户:" + username + " 不存在"); | 44 | + throw new ServiceException(MessageUtils.message("user.not.exists")); |
| 44 | } | 45 | } |
| 45 | else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) | 46 | else if (UserStatus.DELETED.getCode().equals(user.getDelFlag())) |
| 46 | { | 47 | { |
| 47 | log.info("登录用户:{} 已被删除.", username); | 48 | log.info("登录用户:{} 已被删除.", username); |
| 48 | - throw new ServiceException("对不起,您的账号:" + username + " 已被删除"); | 49 | + throw new ServiceException(MessageUtils.message("user.password.delete")); |
| 49 | } | 50 | } |
| 50 | else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) | 51 | else if (UserStatus.DISABLE.getCode().equals(user.getStatus())) |
| 51 | { | 52 | { |
| 52 | log.info("登录用户:{} 已被停用.", username); | 53 | log.info("登录用户:{} 已被停用.", username); |
| 53 | - throw new ServiceException("对不起,您的账号:" + username + " 已停用"); | 54 | + throw new ServiceException(MessageUtils.message("user.blocked")); |
| 54 | } | 55 | } |
| 55 | 56 | ||
| 56 | passwordService.validate(user); | 57 | passwordService.validate(user); |
-
请 注册 或 登录 后发表评论