This commit is contained in:
Pan
2017-08-23 11:39:16 +08:00
committed by 花裤衩
parent 385ec5a762
commit 3c05519a09
17 changed files with 54 additions and 61 deletions

View File

@@ -20,7 +20,7 @@ router.beforeEach((to, from, next) => {
next({ path: '/' })
} else {
if (store.getters.roles.length === 0) { // 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(res => { // 拉取user_info
store.dispatch('GetUserInfo').then(res => { // 拉取user_info
const roles = res.data.role
store.dispatch('GenerateRoutes', { roles }).then(() => { // 生成可访问的路由表
router.addRoutes(store.getters.addRouters) // 动态添加可访问路由表