From 633e9d1c45f9f031ec0cc3a00800075344e9517e Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Mon, 27 Mar 2023 17:26:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=9C=9F=E7=94=A8=E6=88=B7=E4=B9=9F?= =?UTF-8?q?=E5=8F=AF=E4=BB=A5=E7=99=BB=E5=BD=95=E7=B3=BB=E7=BB=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/CustomAuthenticationProvider.java | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java index bd49739..d413eff 100644 --- a/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java +++ b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java @@ -5,7 +5,6 @@ import com.xkrs.model.entity.SysUserEntity; import com.xkrs.service.SysAuthorityService; import com.xkrs.service.SysRoleService; import com.xkrs.service.SysUserService; -import com.xkrs.utilsnew.VipTimeRangeUtils; import com.xkrs.utilsold.DateTimeUtil; import org.springframework.security.authentication.AuthenticationProvider; import org.springframework.security.authentication.BadCredentialsException; @@ -71,20 +70,20 @@ public class CustomAuthenticationProvider implements AuthenticationProvider { // 检查用户是否存在 if (userEntity == null) { - throw new DisabledException("您的账号不存在,请您前往注册。"); + throw new BadCredentialsException("您的账号不存在,请您前往注册。"); } // 检查用户是否激活 if (userEntity.getActiveFlag() != 0) { throw new DisabledException("您的账号未激活,详情请联系客服人员。"); } - // 检查用户是否在VIP时间范围内 - boolean inVipTimeRange = VipTimeRangeUtils.checkIfInVipTimeRange(userEntity.getVipTimeRangeJson()); - // 检查用户是否在试用期范围内 - boolean inTryTimeRange = VipTimeRangeUtils.checkIfInTryTimeRange(userEntity.getAddTime(), userEntity.getDayNum()); - //既不在VIP时间范围内 也不在试用期范围内 - if ((!inVipTimeRange) && (!inTryTimeRange)) { - throw new DisabledException("您的账号已到期,详情请联系客服人员。"); - } +// // 检查用户是否在VIP时间范围内 +// boolean inVipTimeRange = VipTimeRangeUtils.checkIfInVipTimeRange(userEntity.getVipTimeRangeJson()); +// // 检查用户是否在试用期范围内 +// boolean inTryTimeRange = VipTimeRangeUtils.checkIfInTryTimeRange(userEntity.getAddTime(), userEntity.getDayNum()); +// //既不在VIP时间范围内 也不在试用期范围内 +// if ((!inVipTimeRange) && (!inTryTimeRange)) { +// throw new DisabledException("您的账号已到期,详情请联系客服人员。"); +// } // 认证逻辑 String encryptPassword = encry256(password + userEntity.getSalt());