src/layout/components/Navbar.vue
@@ -64,6 +64,10 @@ newPwd: '', confirmPwd: '' }, user: { id: null, name: 'value' }, dialogFormVisible: false, formLabelWidth: '120px', user: { @@ -103,11 +107,15 @@ }, async logout() { // await this.$store.dispatch('user/logout') 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)) }) } }