用户身份切换
This commit is contained in:
@ -13,7 +13,7 @@ const whiteList = ['/login', '/auth-redirect', '/bind', '/register'];
|
||||
router.beforeEach((to, from, next) => {
|
||||
NProgress.start()
|
||||
// 跳过登录验证
|
||||
next();
|
||||
// next();
|
||||
if (getToken()) {
|
||||
to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
|
||||
/* has token*/
|
||||
@ -27,6 +27,7 @@ router.beforeEach((to, from, next) => {
|
||||
// 判断当前用户是否已拉取完user_info信息
|
||||
store.dispatch('GetInfo').then((res) => {
|
||||
store.dispatch('GenerateRoutes',res.data.select_identity).then(accessRoutes => {
|
||||
// store.dispatch('GenerateRoutes',0).then(accessRoutes => { // 测试
|
||||
// 根据roles权限生成可访问的路由表
|
||||
// accessRoutes.forEach(route => {
|
||||
// if (!isHttp(route.path)) {
|
||||
|
Reference in New Issue
Block a user