fix: non-empty path must start with "/"

This commit is contained in:
chenjiahan 2020-05-28 15:26:12 +08:00
parent 4e793189b6
commit 075bc05a75
2 changed files with 3 additions and 3 deletions

View File

@ -47,12 +47,12 @@ function getRoutes() {
if (locales) { if (locales) {
routes.push({ routes.push({
path: '*', path: '/*',
redirect: (route) => `/${getLangFromRoute(route)}/`, redirect: (route) => `/${getLangFromRoute(route)}/`,
}); });
} else { } else {
routes.push({ routes.push({
path: '*', path: '/*',
redirect: '/', redirect: '/',
}); });
} }

View File

@ -28,7 +28,7 @@ function getRoutes() {
if (langs.length) { if (langs.length) {
routes.push({ routes.push({
path: '*', path: '/*',
redirect: (route) => `/${getLangFromRoute(route)}/`, redirect: (route) => `/${getLangFromRoute(route)}/`,
}); });