增加多角色功能和角色切换功能

调整前端获取用户信息方式
This commit is contained in:
pixel
2021-07-22 16:46:09 +08:00
parent 152cb4ec01
commit 8f9ecebf41
20 changed files with 323 additions and 68 deletions

View File

@@ -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 })