diff --git a/src/renderer/src/components/choose-textbook/index.vue b/src/renderer/src/components/choose-textbook/index.vue index 3f56bfe..d208553 100644 --- a/src/renderer/src/components/choose-textbook/index.vue +++ b/src/renderer/src/components/choose-textbook/index.vue @@ -5,7 +5,7 @@ {{ curBookName }} -
+
@@ -60,6 +60,8 @@ const defaultProps = { label: 'label', class: 'textbook-tree' } + +const treeLoading = ref(false) //当前教材ID const curBookId = ref(-1) //当前教材名称 @@ -82,6 +84,7 @@ const refTree = ref(null) //获取教材下面的单元内容 const getSubjectContent = async () => { + treeLoading.value = true const params = { edusubject, edustage, @@ -93,12 +96,17 @@ const getSubjectContent = async () => { if (localStorage.getItem('evaluationList')) { evaluationList.value = JSON.parse(localStorage.getItem('evaluationList')) data = evaluationList.value + treeLoading.value = false } else { - const { rows } = await listEvaluation(params) - localStorage.setItem('evaluationList', JSON.stringify(rows)) - evaluationList.value = rows - data = rows + try { + const { rows } = await listEvaluation(params) + localStorage.setItem('evaluationList', JSON.stringify(rows)) + evaluationList.value = rows + data = rows + } finally { + treeLoading.value = false + } } //获取教材版本 @@ -236,7 +244,7 @@ const getSubject = async () => { subjectList.value = rows.filter(item => item.edustage == edustage && item.edusubject == edusubject && isHaveUnit(item.id)) localStorage.setItem('subjectList', JSON.stringify(subjectList.value)) } - + // 默认第一个 curBookName.value = subjectList.value[0].itemtitle curBookId.value = subjectList.value[0].id diff --git a/src/renderer/src/views/login/index.vue b/src/renderer/src/views/login/index.vue index 3077b89..8b8df3d 100644 --- a/src/renderer/src/views/login/index.vue +++ b/src/renderer/src/views/login/index.vue @@ -54,7 +54,7 @@ const rules = reactive({ password: [{ required: true, trigger: 'blur', message: '请输入您的密码' }] }) -let curWinUrl; +let curWinUrl = import.meta.env.VITE_APP_BUILD_BASE_PATH; //登录 const submitForm = async (formEl) => { @@ -131,9 +131,7 @@ const setCookie = (name, value) => { onMounted(() => { - // 当前窗口URL - curWinUrl = BrowserWindow.getFocusedWindow().webContents.getURL() - + localStorage.clear() getCookie() })