Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5ebff2a6
authored
Mar 23, 2023
by
xinla
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
--no commit message
1 parent
617a7828
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
linkwe-pc/src/permission.js
linkwe-pc/src/permission.js
View file @
5ebff2a
import
router
from
'./router'
import
router
from
'./router'
import
store
from
'./store'
import
store
from
'./store'
import
{
Message
}
from
'element-ui'
import
{
Message
}
from
'element-ui'
//
import NProgress from 'nprogress'
import
NProgress
from
'nprogress'
//
import 'nprogress/nprogress.css'
import
'nprogress/nprogress.css'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
'@/utils/auth'
// NProgress.configure({ showSpinner: fals
e })
NProgress
.
configure
({
showSpinner
:
tru
e
})
const
whiteList
=
[
'/authRedirect'
,
'/bind'
,
'/test'
]
// 不管有没有token都可直接进入的页面路径
const
whiteList
=
[
'/authRedirect'
,
'/bind'
,
'/test'
]
// 不管有没有token都可直接进入的页面路径
const
noLoginList
=
[
'/login'
,
'/register'
]
// 没有token才能进入的页面
const
noLoginList
=
[
'/login'
,
'/register'
]
// 没有token才能进入的页面
...
@@ -24,7 +24,7 @@ function nextTo(to, next, isRpelace) {
...
@@ -24,7 +24,7 @@ function nextTo(to, next, isRpelace) {
}
}
}
}
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
router
.
beforeEach
((
to
,
from
,
next
)
=>
{
//
NProgress.start()
NProgress
.
start
()
// 无需检测token的, 不管有没有token都可直接进入
// 无需检测token的, 不管有没有token都可直接进入
if
(
whiteList
.
includes
(
to
.
path
)
||
to
.
meta
.
isNoLogin
)
{
if
(
whiteList
.
includes
(
to
.
path
)
||
to
.
meta
.
isNoLogin
)
{
next
()
next
()
...
@@ -87,6 +87,6 @@ router.beforeEach((to, from, next) => {
...
@@ -87,6 +87,6 @@ router.beforeEach((to, from, next) => {
})
})
router
.
afterEach
(()
=>
{
router
.
afterEach
(()
=>
{
//
NProgress.done()
NProgress
.
done
()
document
.
getElementById
(
'loader-wrapper'
).
className
=
'loaded'
document
.
getElementById
(
'loader-wrapper'
).
className
=
'loaded'
})
})
Write
Preview
Markdown
is supported
Attach a file
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 post a comment