Skip to content

Commit cfa82b0

Browse files
committed
fix next bug
1 parent 506ecdc commit cfa82b0

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/main.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,9 @@ router.beforeEach((to, from, next) => {
5353
const roles = res.data.role;
5454
store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
5555
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表
56-
next(to.path); // hack方法 确保addRoutes已完成
56+
next(to); // hack方法 确保addRoutes已完成
5757
})
58-
}).catch(err => {
59-
console.log(err);
60-
});
58+
})
6159
} else {
6260
// 没有动态改变权限的需求可直接next() 删除下方权限判断 ↓
6361
if (hasPermission(store.getters.roles, to.meta.role)) {

0 commit comments

Comments
 (0)