Michael Wang 5 жил өмнө
parent
commit
b9a78273be

+ 9 - 0
src/features/OnlineExam/Examing/TextQuestionView.vue

@@ -302,9 +302,18 @@ export default {
   },
   created() {
     this.fetchQRCode();
+
+    this.fetchQRCodeInterval = setInterval(() => {
+      if (!this.qrValue) {
+        this.fetchQRCode();
+      } else {
+        clearInterval(this.fetchQRCodeInterval);
+      }
+    }, 6 * 1000);
   },
   beforeDestroy() {
     clearTimeout(this.fetchQRCodeTimeout);
+    clearInterval(this.fetchQRCodeInterval);
   },
   methods: {
     ...mapMutations(["updateExamQuestion"]),