From 075bc05a75f01a66772c4281ff8893f40a9835a8 Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Thu, 28 May 2020 15:26:12 +0800 Subject: [PATCH] fix: non-empty path must start with "/" --- packages/vant-cli/site/desktop/router.js | 4 ++-- packages/vant-cli/site/mobile/router.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/vant-cli/site/desktop/router.js b/packages/vant-cli/site/desktop/router.js index eea47a9f7..716451922 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: '/*', redirect: (route) => `/${getLangFromRoute(route)}/`, }); } else { routes.push({ - path: '*', + path: '/*', redirect: '/', }); } diff --git a/packages/vant-cli/site/mobile/router.js b/packages/vant-cli/site/mobile/router.js index ec3e37698..0fadfb4b0 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: '/*', redirect: (route) => `/${getLangFromRoute(route)}/`, });