Commit baab7d75 authored by yun's avatar yun

增加白名单功能-liu

parent bda9be27
...@@ -3,6 +3,7 @@ import {getUrlParam} from '@/utils' ...@@ -3,6 +3,7 @@ import {getUrlParam} from '@/utils'
import {getToken, getUserId} from '@/api/test' import {getToken, getUserId} from '@/api/test'
import store from '@/store' import store from '@/store'
const whiteList = ['/CourseTrainOut', '/CourseTrainOutPotal'] // 不重定向白名单
function getButtons() { function getButtons() {
if (store.state.buttons == null) { if (store.state.buttons == null) {
store.dispatch('GetButtonInfo').then(res => { // 拉取用户信息 store.dispatch('GetButtonInfo').then(res => { // 拉取用户信息
...@@ -15,6 +16,9 @@ function getButtons() { ...@@ -15,6 +16,9 @@ function getButtons() {
} }
} }
router.beforeEach((to, from, next) => { router.beforeEach((to, from, next) => {
if (whiteList.indexOf(to.path) !== -1) {
next()
} else {
const userCode = getUrlParam('userCode'), const userCode = getUrlParam('userCode'),
corpId = getUrlParam('corpId'), corpId = getUrlParam('corpId'),
data = { data = {
...@@ -53,4 +57,5 @@ router.beforeEach((to, from, next) => { ...@@ -53,4 +57,5 @@ router.beforeEach((to, from, next) => {
getButtons() getButtons()
next() next()
} }
}
}) })
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