Browse Source

1、登陆逻辑判断调整;

zk 2 years ago
parent
commit
388856083c

+ 7 - 5
sckw-auth/src/main/java/com/sckw/auth/service/impl/AuthServiceImpl.java

@@ -323,17 +323,19 @@ public class AuthServiceImpl implements IAuthService {
 
         //校验Hearder中标识码是否属于系统平台标识码
         boolean bool = false;
-        SpecialResVo specialRes = null;
+        SpecialResVo currentSpecialRes = null;
+        SpecialResVo mainSpecialRes = null;
         for (SpecialResVo specialResVo:specialResVos) {
             bool = specialResVo.getCode().equals(accessSpecial) || bool;
-            specialRes = specialResVo.getCode().equals(accessSpecial) ? specialResVo : null;
+            currentSpecialRes = specialResVo.getCode().equals(accessSpecial) ? specialResVo : currentSpecialRes;
+            mainSpecialRes = specialResVo.getIsMain() == NumberConstant.ONE ? specialResVo : mainSpecialRes;
         }
         if (!bool) {
             return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "系统平台标识码不正确,请联系平台系统管理员确认!");
         }
 
         //校验专场状态
-        if (specialRes != null && specialRes.getIsMain() != Global.NO) {
+        if (currentSpecialRes != null && currentSpecialRes.getStatus() == Global.YES) {
             return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, "您当前使用的平台暂停使用,如有疑问请联系平台系统管理员确认!");
         }
 
@@ -344,8 +346,8 @@ public class AuthServiceImpl implements IAuthService {
 
         //校验企业非专场时,Hearder中标识码是否为主平台标识码
         if (StringUtils.isBlank(special) ) {
-            if (specialRes != null && specialRes.getIsMain() != NumberConstant.ONE) {
-                String msg = "请进入"+ specialRes.getName() +",平台网站为"+ specialRes.getWebsite() +",如有疑问请联系平台系统管理员确认!";
+            if (currentSpecialRes != null && currentSpecialRes.getIsMain() != NumberConstant.ONE) {
+                String msg = "请进入"+ mainSpecialRes.getName() +",平台网站为"+ mainSpecialRes.getWebsite() +",如有疑问请联系平台系统管理员确认!";
                 return HttpResult.error(HttpStatus.PARAMETERS_MISSING_CODE, msg);
             }
         } else {