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 + ")";