增加多角色功能和角色切换功能
调整前端获取用户信息方式
This commit is contained in:
@@ -23,6 +23,7 @@ router.beforeEach(async(to, from, next) => {
|
||||
if (!asyncRouterFlag && store.getters['router/asyncRouters'].length === 0) {
|
||||
asyncRouterFlag++
|
||||
await store.dispatch('router/SetAsyncRouter')
|
||||
await store.dispatch('user/GetUserInfo')
|
||||
const asyncRouters = store.getters['router/asyncRouters']
|
||||
router.addRoutes(asyncRouters)
|
||||
next({ ...to, replace: true })
|
||||
|
Reference in New Issue
Block a user