From 1df2f72ad0321815d5874b4083aac2999bd2da18 Mon Sep 17 00:00:00 2001 From: 马宇豪 <978517621@qq.com> Date: 星期三, 05 七月 2023 17:11:46 +0800 Subject: [PATCH] 修改 --- src/views/Home.vue | 29 +++++++++++++++-------------- 1 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/views/Home.vue b/src/views/Home.vue index abcedf0..9a57f99 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -31,7 +31,9 @@ margin: '15px 16px 24px 16px', }"> <!-- Content --> - <router-view ref="tabContent"></router-view> + <keep-alive include="notice"> + <router-view ref="tabContent"></router-view> + </keep-alive> <div style="height: 30px;text-align: center;line-height: 30px"> 技术支持:中国科学院 </div> @@ -57,7 +59,7 @@ name: "Home", data() { return { - userInfo: {}, + userInfo: getUserInfo(), collapsed: false, //返回logo图片或表述 pageList: [], activePage: '', @@ -70,8 +72,6 @@ pwdMod }, created() { - this.userInfo = getUserInfo() - // this.getDistrictInfo() const route = this.$route if (this.pageList.findIndex(item => item.path === route.path) === -1) { this.pageList.push(this.createPage(route)) @@ -122,16 +122,17 @@ cancelText: '取消', okText: '确认', centered: true, - async onOk() { - const res = await loginOut() - if (res.data.code === 100) { - Session.clear(); // 清除缓存/token等 - // 使用 reload 时,不需要调用 resetRoute() 重置路由 - t.$router.push('/') - // window.location.reload(); - } else { - this.$message.warning(res.data.msg); - } + onOk() { + loginOut().then(res=>{ + if (res.data.code === 100) { + Session.clear(); // 清除缓存/token等 + // 使用 reload 时,不需要调用 resetRoute() 重置路由 + t.$router.push('/') + // window.location.reload(); + } else { + this.$message.warning(res.data.msg); + } + }) }, onCancel() { console.log('Cancel'); -- Gitblit v1.9.2