Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
ferry_web
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jianan
ferry_web
Commits
64956f8c
Commit
64956f8c
authored
May 23, 2025
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加入白名单
parent
c440d9e8
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
2 deletions
+12
-2
src/permission.js
+12
-2
No files found.
src/permission.js
View file @
64956f8c
...
...
@@ -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
)
...
...
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