zouyu
2023-08-28 7d9cfe6dae6f3bc1016cdacb497e4724e22ca3db
src/layout/components/Navbar.vue
@@ -64,6 +64,10 @@
        newPwd: '',
        confirmPwd: ''
      },
      user: {
            id: null,
            name: 'value'
         },
      dialogFormVisible: false,
      formLabelWidth: '120px',
         user: {
@@ -82,7 +86,6 @@
      'avatar'
    ])
  },
   mounted() {
      this.getUser()
   },
@@ -104,11 +107,15 @@
    },
    async logout() {
      // await this.$store.dispatch('user/logout')
      this.$router.push(`/login?redirect=${this.$route.fullPath}`)
      sessionStorage.removeItem("user")
      this.$router.push(`/login?redirect=${this.$route.fullPath}`)
      this.$router.replace({path: '/login'});
      location.reload();
    },
      getUser(){
         get(this.$url.info).then(res=>{
            this.user = res.data
        sessionStorage.setItem("user",JSON.stringify(res.data))
         })
      }
  }