|
@@ -2,10 +2,10 @@ import { AxiosWrapper } from '@/utils/axios-wrapper'
|
|
|
import { checkResult } from '@/utils/checkResult'
|
|
|
import { UserStore } from '@/store/user'
|
|
|
import { cloneDeep, omit } from 'lodash-es'
|
|
|
-import NProgress from "nprogress";
|
|
|
-import "nprogress/nprogress.css";
|
|
|
+import NProgress from 'nprogress'
|
|
|
+import 'nprogress/nprogress.css'
|
|
|
|
|
|
-NProgress.configure({ showSpinner: false });
|
|
|
+NProgress.configure({ showSpinner: false })
|
|
|
|
|
|
const hasNecessaryRoute = (to, router) => {
|
|
|
|
|
@@ -119,7 +119,7 @@ const resetMenus = (menus) => {
|
|
|
|
|
|
export const registerBeforeRouter = async (router) => {
|
|
|
router.beforeEach(async (to, from, next) => {
|
|
|
- NProgress.start();
|
|
|
+ NProgress.start()
|
|
|
const token = localStorage.getItem('token')
|
|
|
if (to.path === '/login') {
|
|
|
next()
|
|
@@ -147,9 +147,11 @@ export const registerBeforeRouter = async (router) => {
|
|
|
|
|
|
|
|
|
export const registerAfterRouter = async (router) => {
|
|
|
- router.afterEach((to, form) => {
|
|
|
- if (to.path === '/login') return
|
|
|
+ router.afterEach(async (to, form) => {
|
|
|
+ if (to.path === '/login') {
|
|
|
+ return
|
|
|
+ }
|
|
|
|
|
|
- NProgress.done();
|
|
|
+ NProgress.done()
|
|
|
})
|
|
|
}
|