mirror of
https://github.com/Tencent/tdesign-vue-next-starter.git
synced 2024-11-10 13:01:14 +08:00
parent
9d8bf86059
commit
8194b3d253
|
@ -37,9 +37,13 @@ export const usePermissionStore = defineStore('permission', {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async restoreRoutes() {
|
async restoreRoutes() {
|
||||||
this.removeRoutes.forEach((item: RouteRecordRaw) => {
|
// 不需要在此额外调用initRoutes更新侧边导肮内容,在登录后asyncRoutes为空会调用
|
||||||
router.addRoute(item);
|
this.asyncRoutes.forEach((item: RouteRecordRaw) => {
|
||||||
|
if (item.name) {
|
||||||
|
router.removeRoute(item.name);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
this.asyncRoutes = [];
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue
Block a user