mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(cli): incorrect route redirect config
This commit is contained in:
parent
a4a96d7146
commit
8a4690a1d2
@ -49,13 +49,17 @@ function getRoutes() {
|
|||||||
routes.push({
|
routes.push({
|
||||||
name: 'notFound',
|
name: 'notFound',
|
||||||
path: '/:path(.*)+',
|
path: '/:path(.*)+',
|
||||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
redirect: (route) => ({
|
||||||
|
name: getLangFromRoute(route),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
routes.push({
|
routes.push({
|
||||||
name: 'notFound',
|
name: 'notFound',
|
||||||
path: '/:path(.*)+',
|
path: '/:path(.*)+',
|
||||||
redirect: '/',
|
redirect: {
|
||||||
|
name: 'home',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,7 +30,9 @@ function getRoutes() {
|
|||||||
routes.push({
|
routes.push({
|
||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
path: '/:path(.*)+',
|
path: '/:path(.*)+',
|
||||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
redirect: (route) => ({
|
||||||
|
name: getLangFromRoute(route),
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
langs.forEach((lang) => {
|
langs.forEach((lang) => {
|
||||||
@ -45,7 +47,9 @@ function getRoutes() {
|
|||||||
routes.push({
|
routes.push({
|
||||||
name: 'NotFound',
|
name: 'NotFound',
|
||||||
path: '/:path(.*)+',
|
path: '/:path(.*)+',
|
||||||
redirect: () => '/',
|
redirect: {
|
||||||
|
name: 'home',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
routes.push({
|
routes.push({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user