|
@@ -2,6 +2,7 @@ import { createRouter, createWebHistory } from 'vue-router'
|
|
import { state } from './store'
|
|
import { state } from './store'
|
|
import NProgress from 'nprogress'
|
|
import NProgress from 'nprogress'
|
|
import Dashboard from './pages/dashboard/index.vue'
|
|
import Dashboard from './pages/dashboard/index.vue'
|
|
|
|
+import NotFound from './pages/404'
|
|
|
|
|
|
NProgress.configure({ showSpinner: false })
|
|
NProgress.configure({ showSpinner: false })
|
|
|
|
|
|
@@ -94,6 +95,11 @@ const router = createRouter({
|
|
component: Dashboard,
|
|
component: Dashboard,
|
|
meta: { auth: true },
|
|
meta: { auth: true },
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ path: '/:pathMatch(.*)*',
|
|
|
|
+ name: 'NotFound',
|
|
|
|
+ component: NotFound,
|
|
|
|
+ },
|
|
],
|
|
],
|
|
})
|
|
})
|
|
|
|
|
|
@@ -109,7 +115,10 @@ router.beforeEach(to => {
|
|
}
|
|
}
|
|
NProgress.start()
|
|
NProgress.start()
|
|
})
|
|
})
|
|
-router.afterEach(() => NProgress.done())
|
|
|
|
|
|
+router.afterEach(() => {
|
|
|
|
+ state.ready = true
|
|
|
|
+ NProgress.done()
|
|
|
|
+})
|
|
router.onError(() => {
|
|
router.onError(() => {
|
|
NProgress.status = null
|
|
NProgress.status = null
|
|
NProgress.remove()
|
|
NProgress.remove()
|