diff --git a/src/renderer/src/hooks/useGetSubject.js b/src/renderer/src/hooks/useGetSubject.js index 1c234ae..07bbb5e 100644 --- a/src/renderer/src/hooks/useGetSubject.js +++ b/src/renderer/src/hooks/useGetSubject.js @@ -7,7 +7,7 @@ export const useGetSubject = async () =>{ // user store const userStore = useUserStore() - const { edustage, edusubject, userId } = userStore.user + const { edustage, edusubject } = userStore.user // 章节List const unitList = ref([]) // 教材List @@ -15,7 +15,6 @@ export const useGetSubject = async () =>{ // 单元章节树结构 let treeData = null - // 根据学科 + 学段 获取所有单元章节 const getSubjectUnit = async () =>{ if(sessionStore.get('subject.unitList')){ @@ -33,7 +32,6 @@ export const useGetSubject = async () =>{ unitList.value = rows sessionStore.set('subject.unitList', rows) } - await getSubject() } @@ -64,7 +62,6 @@ export const useGetSubject = async () =>{ curNode = treeData[0] } sessionStore.set('subject.curNode', curNode) - console.log(curNode,treeData) } } diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index b92f4b8..710c338 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -86,30 +86,6 @@ const currentRoute = ref('') const dev_api = ref(import.meta.env.VITE_APP_BASE_API) const userSubjectList = ref([]) -const handleOutLink = (path, type, name) => { - if (!path) return - if (type === 'hash') { - router.push(path) - } else { - - // key 对应的 linkConfig.js 外部链接配置 - let configObj = outLink().getBaseData() - let fullPath = configObj.fullPath + path - fullPath = fullPath.replaceAll('//', '/') - const { levelFirstId, levelSecondId } = JSON.parse(localStorage.getItem('unitId')) - let unitId = levelSecondId ? levelSecondId : levelFirstId - if (name == '教材分析' || name == '考试分析') { - fullPath += `?unitId=${unitId}` - } - // 通知主进程 - ipcRenderer.send('openWindow', { - key: path, - fullPath: fullPath, - cookieData: { ...configObj.data } - }) - } -} - const activeId = ref('/home') const headerMenus = [ { diff --git a/src/renderer/src/views/desktop/index.vue b/src/renderer/src/views/desktop/index.vue index b990a95..8547950 100644 --- a/src/renderer/src/views/desktop/index.vue +++ b/src/renderer/src/views/desktop/index.vue @@ -180,7 +180,7 @@ const clickMenu = ({isOuter, path, disabled, id}) =>{ fullPath += `?unitId=${id}&bookeId=${rootid}` } else{ - fullPath += `&unitId=${id}&bookeId=${id}` + fullPath += `&unitId=${id}&bookeId=${rootid}` } } fullPath = fullPath.replaceAll('//', '/') diff --git a/src/renderer/src/views/prepare/container/kj-list-item.vue b/src/renderer/src/views/prepare/container/kj-list-item.vue index 99f1da3..7334daa 100644 --- a/src/renderer/src/views/prepare/container/kj-list-item.vue +++ b/src/renderer/src/views/prepare/container/kj-list-item.vue @@ -207,8 +207,8 @@ export default { }, openFileWin(items) { if (items.fileFlag === 'apt') { - let curBook = JSON.parse(localStorage.getItem('curBook')) - const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + this.curNode.id + "&bookId=" + curBook.id; + const { id, rootid } = sessionStore.get('subject.curNode') + const path="/teaching/aptindex?id="+items.fileId + "&unitId=" + id + "&bookId=" + rootid; let configObj = outLink().getBaseData() let fullPath = configObj.fullPath + path fullPath = fullPath.replaceAll('//', '/')