Explorar el Código

fix重复交卷

Michael Wang hace 6 años
padre
commit
6231909c68
Se han modificado 1 ficheros con 5 adiciones y 4 borrados
  1. 5 4
      src/features/OnlineExam/Examing/RemainTime.vue

+ 5 - 4
src/features/OnlineExam/Examing/RemainTime.vue

@@ -20,10 +20,11 @@ export default {
     this.heartbeatInterval = setInterval(() => {
       this.getRemainTimeFromServer();
     }, 60 * 1000);
-    this.remainTimeInterval = setInterval(
-      () => (this.remainTime = this.remainTime - 1000),
-      1000
-    );
+    this.remainTimeInterval = setInterval(() => {
+      if (this.remainTime - 1000 > 0) {
+        this.remainTime = this.remainTime - 1000;
+      }
+    }, 1000);
   },
   beforeDestroy() {
     this.clearIntervals();