.env.product | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/assets/methods/examination.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/assets/methods/resources.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/books/mathBook/view/components/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
.env.product
@@ -1,8 +1,8 @@ VUE_APP_ENV = 'product' VUE_APP_API_URL = "https://jsek.bnuic.com" VUE_APP_RESOURCE_CTX = 'https://jsek.bnuic.com/books/resource/' VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/aviationEtiquette' VUE_APP_PUBLIC_PATH = 'https://jsek.bnuic.com/books/book/toddlerGameImplementation' # VUE_APP_RESOURCE_CTX = 'http://182.92.203.7:3007/books/resource/' # VUE_APP_PUBLIC_PATH = 'http://182.92.203.7:3007/books/book/botany' VUE_APP_BOOK_LIST = "childHealth/lifeCare/sportsAndHealth/embedded/english/artAndDance/artAndDrama/mathBook/botany/civilAviation/civilServices/meetingPlanners/aviationBasicSkills/aviationEtiquette/aviationSafety" VUE_APP_BOOK_ID = 'aviationEtiquette' VUE_APP_BOOK_LIST = "childHealth/lifeCare/sportsAndHealth/embedded/english/artAndDance/artAndDrama/mathBook/botany/civilAviation/civilServices/meetingPlanners/aviationBasicSkills/aviationEtiquette/aviationSafety/toddlerGameImplementation" VUE_APP_BOOK_ID = 'toddlerGameImplementation' src/assets/methods/examination.js
@@ -1,11 +1,11 @@ import MG from "@/assets/js/middleGround/WebMiddleGroundApi"; import {tokenKey} from '@/assets/js/config' import { tokenKey } from "@/assets/js/config"; import getPublicImage from "@/assets/js/middleGround/tool"; // 获取题目列表 const getQuestionList = async (page, questionList, activeBook) => { const token = localStorage.getItem(tokenKey) let collectList = [] if(token) collectList = await getCollectList(activeBook) const token = localStorage.getItem(tokenKey); let collectList = []; if (token) collectList = await getCollectList(activeBook); const oldAnswerData = localStorage.getItem(activeBook.name + "oldAnswerData"); let oldData = null; let oldList = []; @@ -227,43 +227,36 @@ return cardList.filter((item) => item.infoList.length > 0); }; // 获取收藏列表 const getCollectList = async(activeBook) => { const getCollectList = async (activeBook) => { const allCollect = [ { type:'bits', collectList:[] type: "bits", collectList: [], }, { type:'json', collectList:[] type: "json", collectList: [], }, ] await MG.identity .getUserKey({ domain: 'collectData', keys: [activeBook.bookId] }) .then((res) => { try { const collect = JSON.parse(res[0].value) if (collect.length) { allCollect[0].collectList = collect.find( (citem) => citem.type == 'bits' ).collectList allCollect[1].collectList = collect.find( (citem) => citem.type == 'json' ).collectList } } catch (error) { console.log('暂无数据') ]; const res = await MG.identity.getUserKey({ domain: "collectData", keys: [activeBook.bookId], }); try { const collect = JSON.parse(res[0].value); if (collect.length) { allCollect[0].collectList = collect.find( (citem) => citem.type == "bits" ).collectList; allCollect[1].collectList = collect.find( (citem) => citem.type == "json" ).collectList; } }) .catch(() => { console.log('获取收藏报错'); }) console.log('收藏数据',allCollect.find(item => item.type == 'bits').collectList) return allCollect.find(item => item.type == 'bits').collectList } } catch (error) { console.log("暂无数据"); } return allCollect.find((item) => item.type == "bits").collectList; }; const getQuestionData = async (chapter, chapterData, activeBook) => { const data = { ...chapterData }; const oldAnswerData = localStorage.getItem("oldAnswerData"); src/assets/methods/resources.js
@@ -2,38 +2,24 @@ import identityApi from "../js/middleGround/api/identity"; import { tokenKey } from "../js/config"; export const getResourcePath = async (md5, appRefCode = "jingshieke") => { let path = ""; await fileApi .getAliVod({ md5, appRefCode, }) .then((res) => { if (res.data != "" && res.data != undefined) { path = res.data; } else { path = process.env.VUE_APP_API_URL + "/file/api/ApiDownload?md5=" + md5; } }); return path; const res = fileApi.getAliVod({ md5, appRefCode, }); return res.data != "" && res.data != undefined ? res.data : process.env.VUE_APP_API_URL + "/file/api/ApiDownload?md5=" + md5; }; // 获取收藏的资源 export const getCollectResource = async (key) => { if(!localStorage.getItem(tokenKey)) return [] let list = [] await identityApi .getUserKey({ if (!localStorage.getItem(tokenKey)) return []; const res = await identityApi.getUserKey({ domain: "collectResource", keys: [key], }) .then((res) => { if(res.length) { list = JSON.parse(res[0].value) } }); return list } export const setCollectResource = (key,list) => { return res.length ? JSON.parse(res[0].value) : []; }; export const setCollectResource = (key, list) => { identityApi.setUserKey({ setKeyRequests: [ { @@ -42,12 +28,12 @@ value: JSON.stringify(list), }, ], }) } }); }; const MT = { getResourcePath, getCollectResource, setCollectResource setCollectResource, }; export default MT; src/books/mathBook/view/components/index.vue
@@ -871,7 +871,7 @@ console.log("暂无数据"); } }) .catch((res) => { .catch(() => { console.log("index 请求题目收藏id报错"); }); console.log('收藏id',this.collectId);