From 97bec76344fa92b8949c238d14100152707eef7f Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 12 Jun 2024 12:12:18 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E4=BB=AA=E8=A1=A8=E6=9D=BF):=20=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E9=93=BE=E6=8E=A5=E5=85=BC=E5=AE=B92.4=E4=B9=8B?= =?UTF-8?q?=E5=89=8D=E7=89=88=E6=9C=AC=20#9755?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataease/share/manage/XpackShareManage.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java index 5a809c11a7..9df28b897a 100644 --- a/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java +++ b/core/core-backend/src/main/java/io/dataease/share/manage/XpackShareManage.java @@ -209,15 +209,27 @@ public class XpackShareManage { if (StringUtils.isBlank(ciphertext)) return false; String text = RsaUtils.decryptStr(ciphertext); int splitIndex = text.indexOf(","); - String pwd = text.substring(splitIndex + 1); + String pwd; + if (splitIndex == -1) { + splitIndex = 8; + pwd = text.substring(splitIndex); + } else { + pwd = text.substring(splitIndex + 1); + } String uuid = text.substring(0, splitIndex); return StringUtils.equals(xpackShare.getUuid(), uuid) && StringUtils.equals(xpackShare.getPwd(), pwd); } public boolean validatePwd(XpackSharePwdValidator validator) { String ciphertext = RsaUtils.decryptStr(validator.getCiphertext()); + String pwd; int splitIndex = ciphertext.indexOf(","); - String pwd = ciphertext.substring(splitIndex + 1); + if (splitIndex == -1) { + splitIndex = 8; + pwd = ciphertext.substring(splitIndex); + } else { + pwd = ciphertext.substring(splitIndex + 1); + } String uuid = ciphertext.substring(0, splitIndex); QueryWrapper queryWrapper = new QueryWrapper<>(); queryWrapper.eq("uuid", uuid);