Bläddra i källkod

fix: 修复账号删除后依然能登录的问题

gufj 5 månader sedan
förälder
incheckning
823ccc2ce6

+ 10 - 0
bound-link-api/blink-admin/src/main/java/com/cloud/sa/admin/module/system/login/service/LoginService.java

@@ -165,6 +165,12 @@ public class LoginService implements StpInterface {
             return ResponseDTO.userErrorParam("登录名不存在!");
         }
 
+        // 验证账号状态
+        if (employeeEntity.getDeletedFlag()) {
+            saveLoginLog(employeeEntity, ip, userAgent, "账号已删除", LoginLogResultEnum.LOGIN_FAIL);
+            return ResponseDTO.userErrorParam("您的账号已被删除,请联系工作人员!");
+        }
+
         // 验证账号状态
         if (employeeEntity.getDisabledFlag()) {
             saveLoginLog(employeeEntity, ip, userAgent, "账号已禁用", LoginLogResultEnum.LOGIN_FAIL);
@@ -594,6 +600,10 @@ public class LoginService implements StpInterface {
         if (null == employeeEntity) {
             return ResponseDTO.userErrorParam("登录名不存在!");
         }
+        // 验证账号状态
+        if (employeeEntity.getDeletedFlag()) {
+            return ResponseDTO.userErrorParam("您的账号已被删除,请联系工作人员!");
+        }
 
         // 验证账号状态
         if (employeeEntity.getDisabledFlag()) {