完善404页面,非合法路由自动跳转404
This commit is contained in:
@@ -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'
|
||||
}
|
||||
]
|
||||
})
|
||||
|
Reference in New Issue
Block a user