Kaynağa Gözat

Merge commit 'dd43d80135ebc38bb8528956d290e7f84ba8dbe5'

chenhao 2 yıl önce
ebeveyn
işleme
e60ba5cde5

+ 8 - 7
src/features/OnlineExam/Examing/setups/useInitExamData.ts

@@ -7,6 +7,12 @@ type PRACTICE_TYPE = "IN_PRACTICE" | "NO_ANSWER";
 
 export async function initExamData(examId: number, examRecordDataId: number) {
   logger({ cnl: ["server", "local"], pgn: "答题页面", act: "before initData" });
+  const { courseName, courseCode } = (
+    await httpApp.post<{ courseName: string; courseCode: string }>(
+      "/api/ecs_oe_student/examControl/getCourseInfo/" + examRecordDataId,
+      { "axios-retry": { retries: 4 }, noErrorMessage: true }
+    )
+  ).data;
   const [
     { data: weixinAnswerEnabled },
     { data: faceCheckEnabled },
@@ -15,11 +21,10 @@ export async function initExamData(examId: number, examRecordDataId: number) {
     { data: exam },
     { data: paperStruct },
     { data: examQuestionListOrig },
-    { data: _courseName },
   ] = await Promise.all([
     // 是否开放微信小程序作答
     httpApp.get<boolean>(
-      "/api/ecs_exam_work/exam/weixinAnswerEnabled/" + examId,
+      `/api/ecs_exam_work/exam/weixinAnswerEnabled/${examId}?courseCode=${courseCode}`,
       {
         "axios-retry": { retries: 4 },
         noErrorMessage: true,
@@ -62,12 +67,8 @@ export async function initExamData(examId: number, examRecordDataId: number) {
       "/api/ecs_oe_student/examQuestion/findExamQuestionList",
       { "axios-retry": { retries: 4 }, noErrorMessage: true }
     ),
-    httpApp.get<string>(
-      "/api/ecs_oe_student/examControl/courseName/" + examRecordDataId,
-      { "axios-retry": { retries: 4 }, noErrorMessage: true }
-    ),
   ]);
-  store.exam.courseName = _courseName;
+  store.exam.courseName = courseName;
 
   let examQuestionList = examQuestionListOrig;