소스 검색

登陆优化

WANG 6 년 전
부모
커밋
5f9e02410b
1개의 변경된 파일8개의 추가작업 그리고 5개의 파일을 삭제
  1. 8 5
      examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

+ 8 - 5
examcloud-core-basic-service/src/main/java/cn/com/qmth/examcloud/core/basic/service/impl/AuthServiceImpl.java

@@ -135,11 +135,6 @@ public class AuthServiceImpl implements AuthService {
 			if (stuClientLoginLimit) {
 				throw new StatusException("003505", "系统维护中... ...");
 			}
-		} else if (AccountType.COMMON_LOGIN_NAME.equals(accountTypeEnum)) {
-			Boolean commonLoginLimit = (Boolean) systemPropertyService.get("COMMON_LOGIN_LIMIT");
-			if (commonLoginLimit) {
-				throw new StatusException("003506", "系统维护中... ...");
-			}
 		}
 
 		Integer errorTimes = getLoginErrorTimes(accountTypeEnum, accountValue, clientIp);
@@ -227,6 +222,14 @@ public class AuthServiceImpl implements AuthService {
 					throw new StatusException("003003", "账号或密码错误");
 				}
 			} else {
+				// 系统级别登陆限制
+				if (AccountType.COMMON_LOGIN_NAME.equals(accountTypeEnum)) {
+					Boolean commonLoginLimit = (Boolean) systemPropertyService
+							.get("COMMON_LOGIN_LIMIT");
+					if (commonLoginLimit) {
+						throw new StatusException("003506", "系统维护中... ...");
+					}
+				}
 				if (!password.equals(userEntity.getPassword())) {
 					whenLoginError(accountTypeEnum, accountValue, clientIp);
 					throw new StatusException("003003", "账号或密码错误");