From b263fb8f8124768ec9fec5a81a19b5525502db13 Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Wed, 25 May 2022 16:17:19 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A6=85=E9=81=93GET=E6=96=B9=E5=BC=8F?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=9B=BE=E7=89=87=E5=A4=B1=E8=B4=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1013432 --user=陈建星 [缺陷管理] github#13685通过metersphere平台创建缺陷,同步至禅道缺陷之后,meterphere点击【同步缺陷】,禅道缺陷同步失败 https://www.tapd.cn/55049933/s/1163920 --- .../java/io/metersphere/track/issue/ZentaoPlatform.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java index 7da6702cc8..4e68a66cb6 100644 --- a/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java +++ b/backend/src/main/java/io/metersphere/track/issue/ZentaoPlatform.java @@ -15,6 +15,7 @@ import io.metersphere.commons.utils.LogUtil; import io.metersphere.dto.UserDTO; import io.metersphere.track.dto.DemandDTO; import io.metersphere.track.issue.client.ZentaoClient; +import io.metersphere.track.issue.client.ZentaoGetClient; import io.metersphere.track.issue.domain.PlatformUser; import io.metersphere.track.issue.domain.zentao.AddIssueResponse; import io.metersphere.track.issue.domain.zentao.GetIssueResponse; @@ -446,8 +447,7 @@ public class ZentaoPlatform extends AbstractIssuePlatform { } if (Arrays.stream(imgArray).anyMatch(imgType -> StringUtils.equals(imgType, srcContent.substring(srcContent.indexOf('.') + 1)))) { - if (zentaoClient.getBaseUrl().contains("biz")) { - // 禅道企业版 + if (zentaoClient instanceof ZentaoGetClient) { path = zentaoClient.getBaseUrl() + "/index.php?m=file&f=read&fileID=" + srcContent; } else { // 禅道开源版 @@ -456,6 +456,9 @@ public class ZentaoPlatform extends AbstractIssuePlatform { } else { return result; } + } else { + name = name.replaceAll("&", "&"); + path = zentaoClient.getBaseUrl() + path.replaceAll("&", "&"); } // 图片与描述信息之间需换行,否则无法预览图片 result = "\n\n![" + name + "](" + path + ")";