|
@@ -40,18 +40,20 @@ router.beforeEach(async(to, from, next) => {
|
|
} else {
|
|
} else {
|
|
try {
|
|
try {
|
|
// 代理状态更换时清空全部页面标签
|
|
// 代理状态更换时清空全部页面标签
|
|
|
|
+ console.log('代理状态切换 ', store.getters.isChangeProxy)
|
|
if (store.getters.isChangeProxy) {
|
|
if (store.getters.isChangeProxy) {
|
|
store.commit('tagsView/CLEAR_ALL_VIEW')
|
|
store.commit('tagsView/CLEAR_ALL_VIEW')
|
|
|
|
+ store.commit('proxy/CHANGE_PROXY_STATE', false)
|
|
}
|
|
}
|
|
- // store.commit('user/SET_ROLES', roles)
|
|
|
|
await store.dispatch('user/fetchUserInfo')
|
|
await store.dispatch('user/fetchUserInfo')
|
|
await store.dispatch('user/fetchUserVipInfo')
|
|
await store.dispatch('user/fetchUserVipInfo')
|
|
// 根据用户角色获取路由配置
|
|
// 根据用户角色获取路由配置
|
|
const accessRoutes = await store.dispatch('permission/generateRoutes')
|
|
const accessRoutes = await store.dispatch('permission/generateRoutes')
|
|
// 添加路由配置
|
|
// 添加路由配置
|
|
router.addRoutes(accessRoutes)
|
|
router.addRoutes(accessRoutes)
|
|
|
|
+ console.log(router)
|
|
// debugger
|
|
// debugger
|
|
- console.log(to)
|
|
|
|
|
|
+ console.log(accessRoutes)
|
|
// 放行
|
|
// 放行
|
|
next({ ...to, path: '/', replace: true })
|
|
next({ ...to, path: '/', replace: true })
|
|
} catch (err) {
|
|
} catch (err) {
|