Merge pull request #10211 from dataease/pr@dev-v2@fix_link_error

fix(仪表板): 公共链接兼容2.4之前版本 #9755
This commit is contained in:
fit2cloud-chenyw 2024-06-12 12:13:33 +08:00 committed by GitHub
commit 771a58a06b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -209,15 +209,27 @@ public class XpackShareManage {
if (StringUtils.isBlank(ciphertext)) return false; if (StringUtils.isBlank(ciphertext)) return false;
String text = RsaUtils.decryptStr(ciphertext); String text = RsaUtils.decryptStr(ciphertext);
int splitIndex = text.indexOf(","); 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); String uuid = text.substring(0, splitIndex);
return StringUtils.equals(xpackShare.getUuid(), uuid) && StringUtils.equals(xpackShare.getPwd(), pwd); return StringUtils.equals(xpackShare.getUuid(), uuid) && StringUtils.equals(xpackShare.getPwd(), pwd);
} }
public boolean validatePwd(XpackSharePwdValidator validator) { public boolean validatePwd(XpackSharePwdValidator validator) {
String ciphertext = RsaUtils.decryptStr(validator.getCiphertext()); String ciphertext = RsaUtils.decryptStr(validator.getCiphertext());
String pwd;
int splitIndex = ciphertext.indexOf(","); 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); String uuid = ciphertext.substring(0, splitIndex);
QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>(); QueryWrapper<XpackShare> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("uuid", uuid); queryWrapper.eq("uuid", uuid);