更新
This commit is contained in:
@@ -2,10 +2,6 @@
|
||||
* 权限控制
|
||||
*/
|
||||
|
||||
import 'nprogress/nprogress.css'
|
||||
|
||||
import NProgress from 'nprogress'
|
||||
|
||||
import config from './config'
|
||||
import { PageEnum } from './enums/pageEnum'
|
||||
import router, { findFirstValidRoute } from './router'
|
||||
@@ -51,16 +47,11 @@ const addRoutesRecursively = (routes: any, parentPath = '') => {
|
||||
}
|
||||
}
|
||||
|
||||
// NProgress配置
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const loginPath = PageEnum.LOGIN
|
||||
const defaultPath = PageEnum.INDEX
|
||||
// 免登录白名单
|
||||
const whiteList: string[] = [PageEnum.LOGIN, PageEnum.ERROR_403]
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
// 开始 Progress Bar
|
||||
NProgress.start()
|
||||
document.title = to.meta.title ?? config.title
|
||||
const userStore = useUserStore()
|
||||
const tabsStore = useTabsStore()
|
||||
@@ -105,7 +96,3 @@ router.beforeEach(async (to, from, next) => {
|
||||
next({ path: loginPath, query: { redirect: to.fullPath } })
|
||||
}
|
||||
})
|
||||
|
||||
router.afterEach(() => {
|
||||
NProgress.done()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user