Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
VueElementTemplate
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
JIRA
JIRA
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
黄瑜
VueElementTemplate
Commits
87a44ae7
Commit
87a44ae7
authored
Oct 23, 2017
by
Pan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
doc: add note for NProgress.done
parent
1c852db0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
permission.js
src/permission.js
+3
-3
No files found.
src/permission.js
View file @
87a44ae7
...
...
@@ -18,7 +18,7 @@ router.beforeEach((to, from, next) => {
if
(
getToken
())
{
// 判断是否有token
if
(
to
.
path
===
'/login'
)
{
next
({
path
:
'/'
})
NProgress
.
done
()
NProgress
.
done
()
// router在hash模式下 手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
}
else
{
if
(
store
.
getters
.
roles
.
length
===
0
)
{
// 判断当前用户是否已拉取完user_info信息
store
.
dispatch
(
'GetUserInfo'
).
then
(
res
=>
{
// 拉取user_info
...
...
@@ -38,7 +38,7 @@ router.beforeEach((to, from, next) => {
next
()
//
}
else
{
next
({
path
:
'/401'
,
query
:
{
noGoBack
:
true
}})
NProgress
.
done
()
NProgress
.
done
()
// router在hash模式下 手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
}
// 可删 ↑
}
...
...
@@ -48,7 +48,7 @@ router.beforeEach((to, from, next) => {
next
()
}
else
{
next
(
'/login'
)
// 否则全部重定向到登录页
NProgress
.
done
()
//
在hash模式下 改变
手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
NProgress
.
done
()
//
router在hash模式下
手动改变hash 重定向回来 不会触发afterEach 暂时hack方案 ps:history模式下无问题,可删除该行!
}
}
})
...
...
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