toekn 过期

This commit is contained in:
zoujiandong
2023-07-20 13:50:40 +08:00
parent 0613a4b1a3
commit 9de716d073
6 changed files with 55 additions and 33 deletions
+3 -4
View File
@@ -64,7 +64,7 @@ const router = createRouter({
});
// beforeEach router
router.beforeEach(async (to, from, next) => {
router.beforeEach(async(to, from, next) => {
const store = useUserStore();
const permissionStore = usePermissionStore();
@@ -78,9 +78,8 @@ router.beforeEach(async (to, from, next) => {
}else {
// 判断判断权限有无获取
if (store.token && permissionStore.addRouters.length==0) {
//store.getUserInfo();
await permissionStore.getButtonRole();
await permissionStore.getMenuRole();
await permissionStore.getButtonRole();
const menuResult = await permissionStore.getMenuRole();
permissionStore.addRouters.forEach((route) => {
router.addRoute('/', route);
});