Explorar o código

心跳返回的服务器剩余时间为负时,自动提交

Michael Wang %!s(int64=6) %!d(string=hai) anos
pai
achega
a54be37d11
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      src/features/OnlineExam/Examing/RemainTime.vue

+ 3 - 3
src/features/OnlineExam/Examing/RemainTime.vue

@@ -36,12 +36,12 @@ export default {
         "/api/ecs_oe_student/examControl/examHeartbeat"
       );
       if (/\d+/.test(res.data)) {
+        if (res.data <= 0) {
+          this.setShouldSubmitPaper();
+        }
         if (this.remainTime === null) {
           // 仅当剩余考试时间没有被初始化才使用服务器时间。否则使用本机时间。
           this.remainTime = res.data;
-          if (res.data <= 0) {
-            this.setShouldSubmitPaper();
-          }
         }
         this.heartbeatErrorNum = 0;
       } else {