Browse Source

clearTimeout

Michael Wang 5 years ago
parent
commit
a3998c66a1
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/features/OnlineExam/CheckComputer.vue

+ 2 - 1
src/features/OnlineExam/CheckComputer.vue

@@ -790,7 +790,7 @@ export default {
     }, 1000);
     }, 1000);
     openWS({ examRecordDataId: this.$store.state.user.id });
     openWS({ examRecordDataId: this.$store.state.user.id });
     if (!getQRCode(1, "AUDIO", { testEnv: true })) {
     if (!getQRCode(1, "AUDIO", { testEnv: true })) {
-      setTimeout(() => {
+      this.getQRCodeTimeout = setTimeout(() => {
         getQRCode(1, "AUDIO", { testEnv: true });
         getQRCode(1, "AUDIO", { testEnv: true });
       }, 3000);
       }, 3000);
     }
     }
@@ -824,6 +824,7 @@ export default {
   beforeDestroy() {
   beforeDestroy() {
     clearInterval(this.getNowInterval);
     clearInterval(this.getNowInterval);
     clearTimeout(this.checkClockRateTimeout);
     clearTimeout(this.checkClockRateTimeout);
+    clearTimeout(this.getQRCodeTimeout);
     if (this.$refs.video.srcObject) {
     if (this.$refs.video.srcObject) {
       this.$refs.video.srcObject.getTracks().forEach(function(track) {
       this.$refs.video.srcObject.getTracks().forEach(function(track) {
         track.stop();
         track.stop();