Commit 30f160446e7bc507ffc841dd9478d45d459698fc
1 parent
4f770b24
v3.5.0 删除多余的代码
Showing
2 changed files
with
3 additions
and
5 deletions
yudao-ui-admin/src/permission.js
| ... | ... | @@ -21,10 +21,8 @@ router.beforeEach((to, from, next) => { |
| 21 | 21 | // 获取字典数据 |
| 22 | 22 | store.dispatch('dict/loadDictDatas') |
| 23 | 23 | // 判断当前用户是否已拉取完user_info信息 |
| 24 | - store.dispatch('GetInfo').then(res => { | |
| 25 | - // 拉取user_info | |
| 26 | - const roles = res.roles | |
| 27 | - store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => { | |
| 24 | + store.dispatch('GetInfo').then(() => { | |
| 25 | + store.dispatch('GenerateRoutes').then(accessRoutes => { | |
| 28 | 26 | // 根据roles权限生成可访问的路由表 |
| 29 | 27 | router.addRoutes(accessRoutes) // 动态添加可访问路由表 |
| 30 | 28 | next({ ...to, replace: true }) // hack方法 确保addRoutes已完成 | ... | ... |
yudao-ui-admin/src/store/modules/user.js