mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-09-12 22:49:52 +08:00
Merge 7a8304131dcf362765d898e8ec6e1f70711cf301 into 88c28f5d7e23d310d9e6a00b1a40bdad7960787f
This commit is contained in:
commit
d022e4e0db
@ -17,9 +17,9 @@ function hasPermission(roles, permissionRoles) {
|
|||||||
const whiteList = ['/login', '/authredirect']// no redirect whitelist
|
const whiteList = ['/login', '/authredirect']// no redirect whitelist
|
||||||
|
|
||||||
router.beforeEach((to, from, next) => {
|
router.beforeEach((to, from, next) => {
|
||||||
NProgress.start() // start progress bar
|
NProgress.start() // 开启Progress
|
||||||
if (getToken()) { // determine if there has token
|
const token = getToken()
|
||||||
/* has token*/
|
if (typeof (token) !== 'undefined') { // 判断是否有token
|
||||||
if (to.path === '/login') {
|
if (to.path === '/login') {
|
||||||
next({ path: '/' })
|
next({ path: '/' })
|
||||||
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
|
NProgress.done() // if current page is dashboard will not trigger afterEach hook, so manually handle it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user