提交 c67fc49a authored 作者: huaxinzhu's avatar huaxinzhu

Merge branch 'M_2.5_1122'

......@@ -34,10 +34,19 @@ router.beforeEach((to, from, next) => {
store.dispatch('GenerateRoutes', { roles }).then(accessRoutes => {
// 根据roles权限生成可访问的路由表
router.addRoutes(accessRoutes)
if (userInfo && userInfo.state == 1) {
// debugger
if (userInfo.state == 1) {
next({ ...to, replace: true }) // hack方法 确保addRoutes已完成
} else {
next({path:'/process',replace: true});
} else if (userInfo.state == 2){
next({path:'/reviewing',replace: true});
} else if (userInfo.state == 0){
if (userInfo.status == 0) {
next({path:'/process',replace: true});
}else if (userInfo.status == 1) {
next({path:'/fillShopInf',replace: true});
}
} else if (userInfo.state == 3) {
next({path:'/reviewFail',replace: true,params: {...to.params.msg}});
}
})
}).catch(err => {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论