fix: 禅道GET方式同步图片失败
--bug=1013432 --user=陈建星 [缺陷管理] github#13685通过metersphere平台创建缺陷,同步至禅道缺陷之后,meterphere点击【同步缺陷】,禅道缺陷同步失败 https://www.tapd.cn/55049933/s/1163920
This commit is contained in:
parent
06563b66a0
commit
b263fb8f81
|
@ -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 + ")";
|
||||
|
|
Loading…
Reference in New Issue