全国火登录逻辑:过期账号不能登录系统

This commit is contained in:
liuchengqian 2023-03-09 16:27:25 +08:00
parent 5278a709b2
commit bfd418e174

View File

@ -83,6 +83,10 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
throw new DisabledException("用户状态不正常,请联系管理员"); throw new DisabledException("用户状态不正常,请联系管理员");
} }
if (DateTimeUtil.dateTimeToString(LocalDateTime.now()).compareTo(userEntity.getOverTime()) > 0) {
throw new DisabledException("该账号已过期,请联系管理员");
}
// 认证逻辑 // 认证逻辑
String encryptPassword = encry256(password + userEntity.getSalt()); String encryptPassword = encry256(password + userEntity.getSalt());
if (encryptPassword.equals(userEntity.getPassword())) { if (encryptPassword.equals(userEntity.getPassword())) {