mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
fix: router catchAll
This commit is contained in:
@@ -47,12 +47,12 @@ function getRoutes() {
|
|||||||
|
|
||||||
if (locales) {
|
if (locales) {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/*',
|
path: '/:catchAll(.*)',
|
||||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/*',
|
path: '/:catchAll(.*)',
|
||||||
redirect: '/',
|
redirect: '/',
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -28,7 +28,7 @@ function getRoutes() {
|
|||||||
|
|
||||||
if (langs.length) {
|
if (langs.length) {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '/*',
|
path: '/:catchAll(.*)',
|
||||||
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
redirect: (route) => `/${getLangFromRoute(route)}/`,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -41,7 +41,7 @@ function getRoutes() {
|
|||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
routes.push({
|
routes.push({
|
||||||
path: '*',
|
path: '/:catchAll(.*)',
|
||||||
redirect: () => '/',
|
redirect: () => '/',
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user