Ver código fonte

fix rootOrgId

deason 6 anos atrás
pai
commit
c8c7cf91d3

+ 6 - 7
src/main/java/cn/com/qmth/examcloud/app/service/impl/CoreAuthServiceImpl.java

@@ -7,15 +7,15 @@
 
 package cn.com.qmth.examcloud.app.service.impl;
 
+import cn.com.qmth.examcloud.app.core.SysProperty;
 import cn.com.qmth.examcloud.app.core.exception.ApiException;
 import cn.com.qmth.examcloud.app.core.utils.HttpClientBuilder;
 import cn.com.qmth.examcloud.app.core.utils.HttpUtils;
 import cn.com.qmth.examcloud.app.core.utils.JsonMapper;
 import cn.com.qmth.examcloud.app.core.utils.ThreadUtils;
 import cn.com.qmth.examcloud.app.model.*;
-import cn.com.qmth.examcloud.app.core.SysProperty;
-import cn.com.qmth.examcloud.app.service.RedisService;
 import cn.com.qmth.examcloud.app.service.CoreAuthService;
+import cn.com.qmth.examcloud.app.service.RedisService;
 import okhttp3.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
@@ -45,13 +45,12 @@ public class CoreAuthServiceImpl implements CoreAuthService {
 
     @Override
     public boolean isDoingExam(Long rootOrgId, String accountType, String account) {
-        if (rootOrgId == null || StringUtils.isBlank(account)) {
-            log.warn(String.format("[isDoingExam] rootOrgId=%s, account=%s, accountType=%s", rootOrgId, account, accountType));
-            return false;
-        }
+        log.warn(String.format("[check Doing Exam] rootOrgId=%s, account=%s, accountType=%s", rootOrgId, account, accountType));
 
         Map<String, String> params = new HashMap<>();
-        params.put("rootOrgId", rootOrgId.toString());
+        if (rootOrgId != null) {
+            params.put("rootOrgId", rootOrgId.toString());
+        }
 
         if (LoginType.STUDENT_CODE.name().equals(accountType)) {
             params.put("studentCode", account);