diff --git a/src/renderer/src/hooks/useGetSubject.js b/src/renderer/src/hooks/useGetSubject.js index f7882a2..2b61a08 100644 --- a/src/renderer/src/hooks/useGetSubject.js +++ b/src/renderer/src/hooks/useGetSubject.js @@ -55,7 +55,7 @@ export const useGetSubject = async () =>{ treeData = getTreeData(subjectList[0].id) // 设置一个默认的curNode let curNode - if(treeData[0].children){ + if(treeData[0].children && treeData[0].children.length){ curNode = treeData[0].children[0] } else{ diff --git a/src/renderer/src/layout/components/Header.vue b/src/renderer/src/layout/components/Header.vue index 31d79ea..0b7b6f5 100644 --- a/src/renderer/src/layout/components/Header.vue +++ b/src/renderer/src/layout/components/Header.vue @@ -38,7 +38,7 @@ {{ userStore.user.nickName }}