Browse Source

后台api变更

Michael Wang 5 years ago
parent
commit
420fc8e1d7

+ 10 - 5
src/features/OnlineExam/Examing/ExamPaper.vue

@@ -81,6 +81,7 @@ export default {
   props: {
     examId: { type: Number, default: 0 },
     examRecordDataId: { type: Number, default: 0 },
+    fromCache: { type: Boolean, default: false },
   },
   data() {
     return {
@@ -111,20 +112,24 @@ export default {
       ] = await Promise.all([
         this.$http.get("/api/ecs_exam_work/exam/" + this.examId),
         this.$http.get(
-          "/api/ecs_oe_student/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
-            this.examRecordDataId
+          "/api/ecs_oe_admin/examRecordPaperStruct/getExamRecordPaperStruct?examRecordDataId=" +
+            this.examRecordDataId +
+            (this.fromCache ? "&fromCache=1" : "")
         ),
         this.$http.get(
           "/api/ecs_oe_admin/examRecordQuestions/getExamRecordQuestions?examRecordDataId=" +
-            this.examRecordDataId
+            this.examRecordDataId +
+            (this.fromCache ? "&fromCache=1" : "")
         ),
         this.$http.get(
           "/api/ecs_oe_admin/exam/record/data/findExamRecordDataEntity?examRecordDataId=" +
-            this.examRecordDataId
+            this.examRecordDataId +
+            (this.fromCache ? "&fromCache=1" : "")
         ),
         this.$http.get(
           "/api/ecs_oe_admin/practice/getPracticeDetailInfo?examRecordDataId=" +
-            this.examRecordDataId
+            this.examRecordDataId +
+            (this.fromCache ? "&fromCache=1" : "")
         ),
       ]);
       const [exam, paperStruct, examRecordData, courseInfo] = [

+ 2 - 1
src/features/OnlinePractice/OnlinePracticeRecordDetail.vue

@@ -83,6 +83,7 @@
       v-if="shouldShowPaper"
       :exam-id="examId"
       :exam-record-data-id="examRecordDataId"
+      :from-cache="disableGoBack"
     />
   </main-layout>
 </template>
@@ -103,7 +104,7 @@ export default {
     return {
       examRecordResult: [],
       shouldShowPaper: false,
-      disableGoBack: this.$route.query.disableGoBack,
+      disableGoBack: !!this.$route.query.disableGoBack, // 任意字符串都代表true
     };
   },
   computed: {