Эх сурвалжийг харах

缓存本场考试的试题

Michael Wang 6 жил өмнө
parent
commit
5e3939f6ed

+ 7 - 2
src/features/OnlineExam/Examing/QuestionView.vue

@@ -58,9 +58,12 @@ export default {
     ...mapMutations(["updateExamQuestion"]),
     async updateQuestion() {
       const currentExamQuestion = this.examQuestion; // 避免以后执行时,this.examQuestion换掉了
+      const examRecordDataId = this.$route.params.examRecordDataId;
       const res = await this.$http.get(
         "/api/ecs_oe_student/examQuestion/getQuestionContent?questionId=" +
-          currentExamQuestion.questionId
+          currentExamQuestion.questionId +
+          "&exam_record_id=" +
+          examRecordDataId
       );
 
       if (res.data === undefined) {
@@ -149,7 +152,9 @@ export default {
         if (currentOrder < this.examQuestionList.length) {
           this.$http.get(
             "/api/ecs_oe_student/examQuestion/getQuestionContent?questionId=" +
-              this.examQuestionList[currentOrder].questionId
+              this.examQuestionList[currentOrder].questionId +
+              "&exam_record_id=" +
+              examRecordDataId
           );
         }
       }

+ 1 - 1
src/utils/axios.js

@@ -98,7 +98,7 @@ qmInstance.defaults.headers.common["X-Requested-With"] = "XMLHttpRequest"; //标
 qmInstance.get = cachingGet(qmInstance.get, [
   /\/api\/exam_question\/question\/\?question_id/,
   /\/api\/exam_question\/paper_struct\/\?exam_record_id=/,
-  /\/api\/ecs_oe_student\/examQuestion\/getQuestionContent\?questionId=/,
+  /\/api\/ecs_oe_student\/examQuestion\/getQuestionContent\?questionId=.*&exam_record_id=/,
   /\/api\/ecs_exam_work\/exam\/\d+$/,
   /\/api\/ecs_oe_student_face\/upyun$/,
   /\/api\/ecs_oe_student\/examFaceLivenessVerify\/checkFaceLiveness$/