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

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

@@ -90,6 +90,10 @@ export default {
             duration: 15,
             closable: true,
           });
+          this.logger({
+            action: "发出心跳",
+            error: "服务器返回的心跳结果不是数字",
+          });
         }
       } catch (error) {
         if (
@@ -156,10 +160,13 @@ export default {
           });
           return;
         }
-        this.retryHeartbeatTimeout = setTimeout(
-          () => this.getRemainTimeFromServer(),
-          10 * 1000
-        );
+        this.retryHeartbeatTimeout = setTimeout(() => {
+          this.logger({
+            action: "发出心跳",
+            detail: "心跳失败后,再过10秒,重新发出心跳",
+          });
+          this.getRemainTimeFromServer();
+        }, 10 * 1000);
       }
     },
     clearIntervals() {