在登录页用localStorage存储用户信息,登录到首页后获取不到用户信息,需要刷新问题
因从登录页通过this.$router.push(’/home’) 跳转至首页,APP.vue的created函数不再执行,因此要在App.vue页面监听路由,获取用户信息
watch: {
KaTeX parse error: Expected '}', got 'EOF' at end of input: …rCache2 = this.store.state.userInfo;
if (userCache || this.KaTeX parse error: Expected '}', got 'EOF' at end of input: …Cache) || this.store.state.userInfo;
}
}
},
后台管理系统,localstorage本地存储,获取用户信息需刷新问题
最新推荐文章于 2023-06-12 10:22:20 发布