完善404页面,非合法路由自动跳转404

This commit is contained in:
jiayuqi7813
2022-06-29 01:49:05 +08:00
parent 9c3643cf7e
commit 5f188c748e
5 changed files with 210 additions and 2 deletions

View File

@@ -50,6 +50,15 @@ const router = createRouter({
path:'/admin',
name:'Admin',
component: () => import('../views/admin/index.vue'),
},
{
path:'/404',
name:'NotFound',
component: () => import('../views/404.vue'),
},
{
path: '/:pathMatch(.*)',
redirect: '/404'
}
]
})