Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
W
web-monitor
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
Administrator
web-monitor
Commits
576e3776
Commit
576e3776
authored
Oct 25, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: next to login when token is not right
parent
9788cdab
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
permission.js
src/permission.js
+6
-0
No files found.
src/permission.js
View file @
576e3776
...
@@ -2,6 +2,7 @@ import router from './router'
...
@@ -2,6 +2,7 @@ import router from './router'
import
store
from
'./store'
import
store
from
'./store'
import
NProgress
from
'nprogress'
// Progress 进度条
import
NProgress
from
'nprogress'
// Progress 进度条
import
'nprogress/nprogress.css'
// Progress 进度条样式
import
'nprogress/nprogress.css'
// Progress 进度条样式
import
{
Message
}
from
'element-ui'
import
{
getToken
}
from
'@/utils/auth'
// 验权
import
{
getToken
}
from
'@/utils/auth'
// 验权
const
whiteList
=
[
'/login'
]
// 不重定向白名单
const
whiteList
=
[
'/login'
]
// 不重定向白名单
...
@@ -14,6 +15,11 @@ router.beforeEach((to, from, next) => {
...
@@ -14,6 +15,11 @@ router.beforeEach((to, from, next) => {
if
(
store
.
getters
.
roles
.
length
===
0
)
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
store
.
dispatch
(
'GetInfo'
).
then
(
res
=>
{
// 拉取用户信息
store
.
dispatch
(
'GetInfo'
).
then
(
res
=>
{
// 拉取用户信息
next
()
next
()
}).
catch
(()
=>
{
store
.
dispatch
(
'FedLogOut'
).
then
(()
=>
{
Message
.
error
(
'验证失败,请重新登录'
)
next
({
path
:
'/login'
})
})
})
})
}
else
{
}
else
{
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