From 9a8085f4db5b7918cd2007488601668c3a52925d Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Mon, 9 Mar 2020 21:19:43 +0800 Subject: [PATCH] fix(h5): router.base support relative path (./) #571 #1389 --- packages/uni-cli-shared/lib/manifest.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/uni-cli-shared/lib/manifest.js b/packages/uni-cli-shared/lib/manifest.js index 535d0ea079..e28412473e 100644 --- a/packages/uni-cli-shared/lib/manifest.js +++ b/packages/uni-cli-shared/lib/manifest.js @@ -60,9 +60,10 @@ function getH5Options (manifestJson) { let base = h5.router.base - if (base.indexOf('/') !== 0) { + if (base.indexOf('/') !== 0 && base.indexOf('./') !== 0) { base = '/' + base - } + } + if (base.substr(-1) !== '/') { base = base + '/' } @@ -98,4 +99,4 @@ module.exports = { parseManifestJson, getNetworkTimeout, getH5Options -} +} -- GitLab