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 } }) } } else { next() next({ path: '/error/404', query: { errorUrl: to.fullPath } }) return } next() }) export default router