马宇豪
2023-07-05 1df2f72ad0321815d5874b4083aac2999bd2da18
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');