Commit 64956f8c by yuzhenWang

加入白名单

parent c440d9e8
......@@ -9,7 +9,14 @@ NProgress.configure({ showSpinner: false }) // NProgress Configuration
store.dispatch('settings/getSystemSettings')
const whiteList = ['/login', '/auth-redirect'] // no redirect whitelist
const whiteList = [
'/login',
'/auth-redirect',
'/process/all',
'/process/my-create',
'/process/upcoming',
'/process/apply-process-list'
] // no redirect whitelist
router.beforeEach(async(to, from, next) => {
function getQueryParam(name) {
......@@ -62,7 +69,10 @@ router.beforeEach(async(to, from, next) => {
const { roles } = await store.dispatch('user/getInfo')
// generate accessible routes map based on roles
const accessRoutes = await store.dispatch('permission/generateRoutes', roles)
const accessRoutes = await store.dispatch(
'permission/generateRoutes',
roles
)
// dynamically add accessible routes
router.addRoutes(accessRoutes)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment