diff --git a/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java index 300bf22..124b61c 100644 --- a/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java +++ b/src/main/java/com/xkrs/common/account/CustomAuthenticationProvider.java @@ -83,6 +83,10 @@ public class CustomAuthenticationProvider implements AuthenticationProvider { throw new DisabledException("用户状态不正常,请联系管理员"); } + if (DateTimeUtil.dateTimeToString(LocalDateTime.now()).compareTo(userEntity.getOverTime()) > 0) { + throw new DisabledException("该账号已过期,请联系管理员"); + } + // 认证逻辑 String encryptPassword = encry256(password + userEntity.getSalt()); if (encryptPassword.equals(userEntity.getPassword())) {