From b94fffb01c94100b34e2908b4fe79c1c554b0912 Mon Sep 17 00:00:00 2001 From: xuhy <3313886187@qq.com> Date: 星期四, 02 一月 2025 13:55:03 +0800 Subject: [PATCH] 代码 --- ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java | 23 +++++++++++++---------- 1 files changed, 13 insertions(+), 10 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java index 72ae442..4f116dc 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/SysLoginService.java @@ -139,16 +139,19 @@ // 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); -- Gitblit v1.7.1