src/router/index.js
@@ -7,14 +7,12 @@ routes: [ ...errorPage, ...h5], }) router.beforeEach((to, from, next) => { router.beforeEach(async (to, from, next) => { if (!to.matched.length) { if (to.path === '/') { next({ path: '/error/404', query: { errorUrl: to.path } }) next({ path: '/error/404', query: { errorUrl: to.fullPath } }) return } } else { next() } }) export default router