From bfd418e174abe29e41b2947acd18e70accfe66f6 Mon Sep 17 00:00:00 2001 From: liuchengqian Date: Thu, 9 Mar 2023 16:27:25 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=9B=BD=E7=81=AB=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E9=80=BB=E8=BE=91=EF=BC=9A=E8=BF=87=E6=9C=9F=E8=B4=A6=E5=8F=B7?= =?UTF-8?q?=E4=B8=8D=E8=83=BD=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 --- .../com/xkrs/common/account/CustomAuthenticationProvider.java | 4 ++++ 1 file changed, 4 insertions(+) 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())) {