From ed42191fcef9db65d91e097bfc538ca9e41bd7eb Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 28 May 2020 12:40:38 +0800 Subject: [PATCH] =?UTF-8?q?BI-65801=20refactor:=20=E9=A2=84=E7=A0=94?= =?UTF-8?q?=E8=A1=A8=E8=B7=AF=E7=94=B1=E8=B7=B3=E8=BD=AC=E6=97=B6=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + src/router/router.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/changelog.md b/changelog.md index d0dbaf2c1..fa5fcd40f 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-05) +- 修复调用BI.history.navigate(XXX, {trigger: false})时, XXX包含中文空格等字符仍然触发回调的问题 - 新增BI.after和BI.before方法 - 修复bi.button设置宽度并配置iconCls后,文本很长的情况下显示截断的问题 - 填加bi-user-select-enable和bi-user-select-disable通用类名 diff --git a/src/router/router.js b/src/router/router.js index 2e7e9cbb2..5ca13eda5 100644 --- a/src/router/router.js +++ b/src/router/router.js @@ -490,7 +490,12 @@ // calls `loadUrl`, normalizing across the hidden iframe. checkUrl: function (e) { var current = this.getFragment(); - + try { + // getFragment 得到的值是编码过的,而this.fragment是没有编码过的 + // 英文路径没有问题,遇上中文和空格有问题了 + current = decodeURIComponent(current); + } catch { + } // If the user pressed the back button, the iframe's hash will have // changed and we should use that for comparison. if (current === this.fragment && this.iframe) {