演示提交

This commit is contained in:
熊丽君
2022-02-16 08:54:56 +08:00
parent d6684a154b
commit 43023de455
33 changed files with 2417 additions and 1633 deletions

View File

@ -25,17 +25,16 @@ router.beforeEach((to, from, next) => {
} else {
if (store.getters.roles.length === 0) {
// 判断当前用户是否已拉取完user_info信息
store.dispatch('GetInfo').then(() => {
next({ ...to, replace: true })
// store.dispatch('GenerateRoutes').then(accessRoutes => {
// // 根据roles权限生成可访问的路由表
// accessRoutes.forEach(route => {
// if (!isHttp(route.path)) {
// router.addRoute(route) // 动态添加可访问路由表
// }
// })
// next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
// })
store.dispatch('GetInfo').then((res) => {
store.dispatch('GenerateRoutes',res.data.select_identity).then(accessRoutes => {
// 根据roles权限生成可访问的路由表
// accessRoutes.forEach(route => {
// if (!isHttp(route.path)) {
// router.addRoute(route) // 动态添加可访问路由表
// }
// })
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
})
}).catch(err => {
store.dispatch('LogOut').then(() => {
ElMessage.error(err)