feat: 进入 404 页面时保留当前 URL (#14)
This commit is contained in:
parent
63ca3831ea
commit
e4b5c2781e
@ -17,6 +17,23 @@ export const constantRoutes: RouteRecordRaw[] = [
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "/403",
|
||||||
|
component: () => import("@/views/error-page/403.vue"),
|
||||||
|
name: "403",
|
||||||
|
meta: {
|
||||||
|
hidden: true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "/404",
|
||||||
|
component: () => import("@/views/error-page/404.vue"),
|
||||||
|
name: "404",
|
||||||
|
meta: {
|
||||||
|
hidden: true
|
||||||
|
},
|
||||||
|
alias: "/:pathMatch(.*)*"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: "/login",
|
path: "/login",
|
||||||
component: () => import("@/views/login/index.vue"),
|
component: () => import("@/views/login/index.vue"),
|
||||||
@ -173,32 +190,11 @@ export const asyncRoutes: RouteRecordRaw[] = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: "/:pathMatch(.*)*", // 必须将 'ErrorPage' 路由放在最后, Must put the 'ErrorPage' route at the end
|
path: "/:pathMatch(.*)*", // 必须将 'ErrorPage' 路由放在最后, Must put the 'ErrorPage' route at the end
|
||||||
component: Layout,
|
|
||||||
redirect: "/404",
|
redirect: "/404",
|
||||||
name: "ErrorPage",
|
name: "ErrorPage",
|
||||||
meta: {
|
meta: {
|
||||||
title: "错误页面",
|
|
||||||
icon: "404",
|
|
||||||
hidden: true
|
hidden: true
|
||||||
},
|
}
|
||||||
children: [
|
|
||||||
{
|
|
||||||
path: "403",
|
|
||||||
component: () => import("@/views/error-page/403.vue"),
|
|
||||||
name: "403",
|
|
||||||
meta: {
|
|
||||||
title: "403"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "404",
|
|
||||||
component: () => import("@/views/error-page/404.vue"),
|
|
||||||
name: "404",
|
|
||||||
meta: {
|
|
||||||
title: "404"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user