fix: router catchAll

This commit is contained in:
chenjiahan 2020-07-04 21:30:31 +08:00
parent 7346f20e96
commit 59f9b851d6
2 changed files with 4 additions and 4 deletions

View File

@ -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: '/',
}); });
} }

View File

@ -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: () => '/',
}); });