Merge bb9bff00af
into 3cc3e134c2
This commit is contained in:
commit
89b061ae5c
|
@ -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…
Reference in New Issue