From 897a8157e791901b5993fc74c1594b78df8305b6 Mon Sep 17 00:00:00 2001 From: ZF sun <34314687@qq.com> Date: Fri, 10 Jul 2026 10:47:48 +0800 Subject: [PATCH] =?UTF-8?q?fix(util):=20=E4=BF=AE=E5=A4=8Durl=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E7=BC=96=E7=A0=81=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除了冗余的try-catch编码逻辑,直接返回原始字符串 直接返回原始字符串,简化了url参数编码的处理流程,避免了不必要的编解码操作 --- common/js/util.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/common/js/util.js b/common/js/util.js index 65ec242..2c55fe2 100644 --- a/common/js/util.js +++ b/common/js/util.js @@ -649,11 +649,12 @@ export default { // - 任何不能 decode 的非法序列(如裸 %) 走 catch 路径,直接 encode const safeEncode = (v) => { const s = v == null ? '' : String(v); - try { - return encodeURIComponent(decodeURIComponent(s)); - } catch (e) { - return encodeURIComponent(s); - } + // try { + // return encodeURIComponent(decodeURIComponent(s)); + // } catch (e) { + // return encodeURIComponent(s); + // } + return s; }; const queryStr = Object.keys(merged) .map(k => safeEncode(k) + '=' + safeEncode(merged[k]))