diff --git a/common/js/util.js b/common/js/util.js index 4cb24d3..21c39c8 100644 --- a/common/js/util.js +++ b/common/js/util.js @@ -524,7 +524,10 @@ export const adaptSubpackageUrl = (url) => { }); } - return replacePrefix(url); + // 兜底:把 3 个及以上的连续 `/` 收敛为 2 个,只动 path 部分(避免影响 `https://` 这种 scheme) + // 例如把 `/pages//webview///webview?x=1` 修正成 `/pages//webview//webview?x=1` + const collapsed = url.replace(/([^:])\/{3,}/g, '$1//'); + return replacePrefix(collapsed); } // 归一化任意路径:确保以 '/' 开头,去除 query,适配子包