Commit 5ebff2a6 by xinla

--no commit message

1 parent 617a7828
import router from './router'
import store from './store'
import { Message } from 'element-ui'
// import NProgress from 'nprogress'
// import 'nprogress/nprogress.css'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { getToken } from '@/utils/auth'
// NProgress.configure({ showSpinner: false })
NProgress.configure({ showSpinner: true })
const whiteList = ['/authRedirect', '/bind', '/test'] // 不管有没有token都可直接进入的页面路径
const noLoginList = ['/login', '/register'] // 没有token才能进入的页面
......@@ -24,7 +24,7 @@ function nextTo(to, next, isRpelace) {
}
}
router.beforeEach((to, from, next) => {
// NProgress.start()
NProgress.start()
// 无需检测token的, 不管有没有token都可直接进入
if (whiteList.includes(to.path) || to.meta.isNoLogin) {
next()
......@@ -87,6 +87,6 @@ router.beforeEach((to, from, next) => {
})
router.afterEach(() => {
// NProgress.done()
NProgress.done()
document.getElementById('loader-wrapper').className = 'loaded'
})
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!