From e9a0bf39b68ba1f12082739667b7ebf7c914301e Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期四, 23 五月 2024 15:22:13 +0800 Subject: [PATCH] 优化 --- src/assets/methods/examination.js | 10 ++++------ 1 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/assets/methods/examination.js b/src/assets/methods/examination.js index 3e059f9..9701e05 100644 --- a/src/assets/methods/examination.js +++ b/src/assets/methods/examination.js @@ -1,7 +1,6 @@ -import { activeBook, goodsStore } from "@/assets/js/config"; import MG from "@/assets/js/middleGround/WebMiddleGroundApi"; import getPublicImage from "@/assets/js/middleGround/tool"; -const getQuestionList = async (oldList, questionList) => { +const getQuestionList = async (oldList, questionList,activeBook) => { let cardList = [ { catalogName: "鍗曢�夐", @@ -29,11 +28,10 @@ let shortArr = []; // 绠�绛� let multipleChoiceArr = []; // 澶氶�� let completionArr = []; // 濉┖ - console.log("active", activeBook); for (let qindex = 0; qindex < questionList.length; qindex++) { const qitem = questionList[qindex]; let query = { - storeInfo: goodsStore, + storeInfo: activeBook.storeRefcode, path: "*", cmsPath: activeBook.rootCmsItemId, cmsType: "*", @@ -212,7 +210,7 @@ return cardList.filter((item) => item.infoList.length > 0); }; -const getQuestionData = async (chapter, chapterData) => { +const getQuestionData = async (chapter, chapterData,activeBook) => { const data = { ...chapterData }; const oldAnswerData = localStorage.getItem("oldAnswerData"); const oldData = oldAnswerData ? JSON.parse(oldAnswerData) : {}; @@ -225,7 +223,7 @@ if (oldChapterData) { oldList = oldChapterData[key]; } - data[key] = await getQuestionList(oldList, chapterData[key]); + data[key] = await getQuestionList(oldList, chapterData[key],activeBook); } return data; }; -- Gitblit v1.9.1