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