|
@@ -32,11 +32,35 @@ Vue.mixin({
|
|
|
async checkExamInProgress() {
|
|
|
try {
|
|
|
// 断点续考
|
|
|
- const examingRes = (await this.$http.get(
|
|
|
- "/api/ecs_oe_student/examControl/checkExamInProgress"
|
|
|
- )).data;
|
|
|
+ // const examingRes = (await this.$http.get(
|
|
|
+ // "/api/ecs_oe_student/examControl/checkExamInProgress"
|
|
|
+ // )).data;
|
|
|
|
|
|
- if (examingRes.isExceed) {
|
|
|
+ let examingRes;
|
|
|
+ for (let i = 0; i < 20; i++) {
|
|
|
+ examingRes = await this.$http.get(
|
|
|
+ "/api/ecs_oe_student/examControl/checkExamInProgress"
|
|
|
+ );
|
|
|
+ console.log(examingRes);
|
|
|
+ if (examingRes.data.code === "S-101000") {
|
|
|
+ continue;
|
|
|
+ } else if (examingRes.data.code === "000000") {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ await new Promise(resolve => setTimeout(() => resolve(), 3000));
|
|
|
+ }
|
|
|
+ if (examingRes.data.code !== "000000") {
|
|
|
+ window._hmt.push([
|
|
|
+ "_trackEvent",
|
|
|
+ "断点续考处理异常",
|
|
|
+ "调用断点续考接口超过次数",
|
|
|
+ ]);
|
|
|
+ throw "调用断点续考接口超过次数";
|
|
|
+ }
|
|
|
+
|
|
|
+ examingRes = examingRes.data.data; // 保持和原接口一致
|
|
|
+
|
|
|
+ if (examingRes && examingRes.isExceed) {
|
|
|
// 超出断点续考次数的逻辑,仅此block
|
|
|
this.$Message.info({
|
|
|
content: `超出最大断点续考次数(${examingRes.maxInterruptNum}),正在自动交卷...`,
|