fix(cli): vue-router catchAll usage

This commit is contained in:
chenjiahan 2020-09-19 06:29:05 +08:00
parent ae26d6d4d9
commit ffeb656505
2 changed files with 8 additions and 4 deletions

View File

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

View File

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