From 157bc08f84999104e3dfedb464458a80fa89016d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chuailei000=E2=80=9D?= <2280131253@qq.com> Date: Mon, 18 Jul 2022 15:09:18 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=B3=E9=94=AE?= =?UTF-8?q?=E8=B5=84=E4=BA=A7=E6=A0=91=E5=90=8E=E7=82=B9=E5=87=BB=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B0=E5=85=B6=E4=BB=96=E7=BB=84=E7=BB=87=E4=B8=8D?= =?UTF-8?q?=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/common.js | 8 ++++++-- src/utils/org.js | 4 ++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/utils/common.js b/src/utils/common.js index 70e04abbf..4c260272c 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -155,8 +155,12 @@ export function formatDate(inputTime) { const uuidPattern = /[0-9a-zA-Z\-]{36}/ -export function hasUUID(s) { - return s.search(uuidPattern) !== -1 +export function hasUUID(path) { + const index = path.indexOf('?') + if (index !== -1) { + path = path.substring(0, index) + } + return path.search(uuidPattern) !== -1 } export function replaceUUID(s, n) { diff --git a/src/utils/org.js b/src/utils/org.js index 4eb18ba71..6cd0a5d3d 100644 --- a/src/utils/org.js +++ b/src/utils/org.js @@ -26,6 +26,10 @@ async function changeOrg(org) { path = _.trimEnd(path, '/') location.href = path } else { + const index = path.indexOf('?') + if (index !== -1) { + location.href = path.substring(0, index) + } setTimeout(() => location.reload(), 400) } }