Kaynağa Gözat

修复心跳时间被重复获取

Michael Wang 6 yıl önce
ebeveyn
işleme
edab530e48

+ 14 - 2
src/features/OnlineExam/Examing/ExamingEnd.vue

@@ -37,7 +37,7 @@
 <script>
 import { mapState as globalMapState } from "vuex";
 import { createNamespacedHelpers } from "vuex";
-const { mapState } = createNamespacedHelpers("examingHomeModule");
+const { mapState, mapMutations } = createNamespacedHelpers("examingHomeModule");
 
 export default {
   data() {
@@ -75,11 +75,23 @@ export default {
     //   .map(q => q.groupScore)
     //   .reduce((p, c) => p + c);
   },
+  beforeDestroy() {
+    this.updateExamState({
+      exam: null,
+      paperStruct: null,
+      examQuestionList: null
+    });
+    this.updateExamResult({
+      examResult: null
+    });
+  },
   computed: {
     ...globalMapState(["user"]),
     ...mapState(["exam", "examResult", "paperStruct"])
   },
-  methods: {}
+  methods: {
+    ...mapMutations(["updateExamState", "updateExamResult"])
+  }
 };
 </script>
 

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

@@ -44,7 +44,7 @@ export default {
       } else {
         this.heartbeatErrorNum++;
         if (this.heartbeatErrorNum >= 10) {
-          // 心跳异常5次则退出考试
+          // 心跳异常10次则退出考试
           this.$Modal.error({
             title: "网络连接异常",
             content: "退出考试",