mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 10:48:25 +08:00
fix: 修正如果在使用了 userStore 内的数据的页面进行退出登录操作时会因为相关数据提前清除而报错的问题 (#274)
* fix: 修正如果在使用了 userStore 内的数据的页面进行退出登录操作时会因为相关数据提前清除而报错的问题 * fix: 移除多余的
This commit is contained in:
parent
490ca9570d
commit
ea9e14507a
|
@ -18,8 +18,6 @@ router.beforeEach(async (to, from, next) => {
|
|||
const { token } = userStore;
|
||||
if (token) {
|
||||
if (to.path === '/login') {
|
||||
userStore.logout();
|
||||
permissionStore.restore();
|
||||
next();
|
||||
return;
|
||||
}
|
||||
|
@ -58,6 +56,10 @@ router.beforeEach(async (to, from, next) => {
|
|||
}
|
||||
});
|
||||
|
||||
router.afterEach(() => {
|
||||
router.afterEach((to) => {
|
||||
if (to.path === '/login') {
|
||||
userStore.logout();
|
||||
permissionStore.restore();
|
||||
}
|
||||
NProgress.done();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user