|
@@ -16,7 +16,6 @@ import cn.com.qmth.examcloud.app.core.utils.ThreadUtils;
|
|
|
import cn.com.qmth.examcloud.app.model.*;
|
|
|
import cn.com.qmth.examcloud.app.service.CoreAuthService;
|
|
|
import cn.com.qmth.examcloud.app.service.RedisService;
|
|
|
-import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import okhttp3.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
@@ -49,12 +48,13 @@ public class CoreAuthServiceImpl implements CoreAuthService {
|
|
|
|
|
|
@Override
|
|
|
public boolean isDoingExam(Long rootOrgId, String accountType, String account) {
|
|
|
- log.warn(String.format("[Check Doing Exam] rootOrgId=%s, account=%s, accountType=%s", rootOrgId, account, accountType));
|
|
|
-
|
|
|
if (rootOrgId == null) {
|
|
|
- throw new StatusException("400", "学校ID为不能空!");
|
|
|
+ log.warn("[Check Doing Exam] rootOrgId is null");
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
+ log.info(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 (LoginType.STUDENT_CODE.name().equals(accountType)) {
|
|
@@ -91,7 +91,8 @@ public class CoreAuthServiceImpl implements CoreAuthService {
|
|
|
log.error(e.getMessage(), e);
|
|
|
}
|
|
|
|
|
|
- throw new StatusException("500", "考试状态检查异常!");
|
|
|
+ log.warn("[Check Doing Exam] fail");
|
|
|
+ return false;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -138,7 +139,7 @@ public class CoreAuthServiceImpl implements CoreAuthService {
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error(e.getMessage(), e);
|
|
|
- throw new StatusException("500", "登录异常!");
|
|
|
+ return new Result().error("登录异常!");
|
|
|
}
|
|
|
}
|
|
|
|