From 59f9b851d62028f6df5415c68459d29e7445b441 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sat, 4 Jul 2020 21:30:31 +0800 Subject: [PATCH] fix: router catchAll --- packages/vant-cli/site/desktop/router.js | 4 ++-- packages/vant-cli/site/mobile/router.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/vant-cli/site/desktop/router.js b/packages/vant-cli/site/desktop/router.js index 716451922..fd758e4e5 100644 --- a/packages/vant-cli/site/desktop/router.js +++ b/packages/vant-cli/site/desktop/router.js @@ -47,12 +47,12 @@ function getRoutes() { if (locales) { routes.push({ - path: '/*', + path: '/:catchAll(.*)', redirect: (route) => `/${getLangFromRoute(route)}/`, }); } else { routes.push({ - path: '/*', + path: '/:catchAll(.*)', redirect: '/', }); } diff --git a/packages/vant-cli/site/mobile/router.js b/packages/vant-cli/site/mobile/router.js index 0fadfb4b0..8bb18416b 100644 --- a/packages/vant-cli/site/mobile/router.js +++ b/packages/vant-cli/site/mobile/router.js @@ -28,7 +28,7 @@ function getRoutes() { if (langs.length) { routes.push({ - path: '/*', + path: '/:catchAll(.*)', redirect: (route) => `/${getLangFromRoute(route)}/`, }); @@ -41,7 +41,7 @@ function getRoutes() { }); } else { routes.push({ - path: '*', + path: '/:catchAll(.*)', redirect: () => '/', });