Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mt-education-mobile
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王旭
mt-education-mobile
Commits
baab7d75
Commit
baab7d75
authored
Dec 27, 2019
by
yun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加白名单功能-liu
parent
bda9be27
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
34 deletions
+39
-34
permission.js
src/permission.js
+39
-34
No files found.
src/permission.js
View file @
baab7d75
...
@@ -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
()
}
}
}
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment