|
|
@ -14,9 +14,10 @@ router.beforeEach((to, from, next) => { |
|
|
|
} else if(role && to.path == '/login') { |
|
|
|
} else if(role && to.path == '/login') { |
|
|
|
next('/index') |
|
|
|
next('/index') |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let mg = from.query.mg |
|
|
|
const mg = from.query.mg |
|
|
|
let routes = store.state.auth.routes |
|
|
|
const schoolId = from.query.schoolId |
|
|
|
let toPath = to.path |
|
|
|
const routes = store.state.auth.routes |
|
|
|
|
|
|
|
const toPath = to.path |
|
|
|
// mg是判断是否是管理员的参数,base64解码后如果等于true则为管理员,否则为普通用户。
|
|
|
|
// mg是判断是否是管理员的参数,base64解码后如果等于true则为管理员,否则为普通用户。
|
|
|
|
// 如果是管理员则需要从获取的路由权限里判断当前访问页面是否有权限访问,如果没权限访问则跳转到403
|
|
|
|
// 如果是管理员则需要从获取的路由权限里判断当前访问页面是否有权限访问,如果没权限访问则跳转到403
|
|
|
|
if((mg && atob(decodeURI(mg)) === 'true') || (to.query.mg && atob(decodeURI(to.query.mg)) === 'true')){ |
|
|
|
if((mg && atob(decodeURI(mg)) === 'true') || (to.query.mg && atob(decodeURI(to.query.mg)) === 'true')){ |
|
|
@ -28,7 +29,10 @@ router.beforeEach((to, from, next) => { |
|
|
|
if(!to.query.mg){ |
|
|
|
if(!to.query.mg){ |
|
|
|
next({ |
|
|
|
next({ |
|
|
|
path: toPath, |
|
|
|
path: toPath, |
|
|
|
query: {mg} |
|
|
|
query: { |
|
|
|
|
|
|
|
mg, |
|
|
|
|
|
|
|
schoolId |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
next() |
|
|
|
next() |
|
|
|