Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
Y
yn-science-front
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
徐俊
yn-science-front
Commits
4f6354fd
Commit
4f6354fd
authored
Dec 04, 2024
by
wangxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
33
parent
83fb7f86
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
8 deletions
+2
-8
index.js
src/router/index.js
+2
-8
No files found.
src/router/index.js
View file @
4f6354fd
...
@@ -320,25 +320,19 @@ router.beforeEach(async (to, from, next) => {
...
@@ -320,25 +320,19 @@ router.beforeEach(async (to, from, next) => {
const
hasUser
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'user'
))
const
hasUser
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'user'
))
const
hasMenu
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
const
hasMenu
=
JSON
.
parse
(
window
.
sessionStorage
.
getItem
(
'menuList'
))
if
(
hasUser
&&
hasMenu
)
{
if
(
hasUser
&&
hasMenu
)
{
if
(
hasUser
.
type
===
'3'
&&
!!!
hasUser
.
projType
&&
hasUser
.
roles
!=
'4'
)
{
if
(
to
.
path
===
'/sys'
)
{
if
(
to
.
path
===
'/sys'
)
{
if
(
!!!
hasUser
.
projType
&&
hasUser
.
type
===
'3'
&&
hasUser
.
roles
!=
'4'
)
{
next
()
next
()
NProgress
.
done
()
NProgress
.
done
()
}
else
{
next
({
path
:
'/'
})
NProgress
.
done
()
}
}
else
{
}
else
{
if
(
!!!
hasUser
.
projType
&&
hasUser
.
type
===
'3'
&&
hasUser
.
roles
!=
'4'
)
{
next
(
`/sys`
)
next
(
`/sys`
)
NProgress
.
done
()
NProgress
.
done
()
}
}
else
{
}
else
{
await
store
.
dispatch
(
'app/auth'
,
to
.
path
)
await
store
.
dispatch
(
'app/auth'
,
to
.
path
)
next
()
next
()
NProgress
.
done
()
NProgress
.
done
()
}
}
}
}
else
{
}
else
{
await
store
.
dispatch
(
'user/getUser'
)
await
store
.
dispatch
(
'user/getUser'
)
next
({
...
to
,
replace
:
true
})
next
({
...
to
,
replace
:
true
})
...
...
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