fix(测试跟踪): 禅道同步缺陷后图片无法展示
--bug=1020301 --user=陈建星 【测试跟踪】github #20125, 同步禅道缺陷后,缺陷内容中的图片无法展示 https://www.tapd.cn/55049933/s/1307379
This commit is contained in:
parent
aa3d60c468
commit
329c928d10
|
@ -38,6 +38,8 @@ import org.springframework.util.MultiValueMap;
|
|||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URLDecoder;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
@ -562,10 +564,14 @@ public class ZentaoPlatform extends AbstractIssuePlatform {
|
|||
}
|
||||
} else {
|
||||
name = name.replaceAll("&", "&");
|
||||
path = zentaoClient.getBaseUrl() + path.replaceAll("&", "&");
|
||||
try {
|
||||
URI uri = new URI(zentaoClient.getBaseUrl());
|
||||
path = uri.getScheme() + "://" + uri.getHost() + path.replaceAll("&", "&");
|
||||
} catch (URISyntaxException e) {
|
||||
path = zentaoClient.getBaseUrl() + path.replaceAll("&", "&");
|
||||
LogUtil.error(e);
|
||||
}
|
||||
}
|
||||
// 专业版格式有差异,解析完会出现两个 /pro,去掉一个
|
||||
path.replace("/pro/pro", "/pro");
|
||||
path = "/resource/md/get/url?url=" + URLEncoder.encode(path, StandardCharsets.UTF_8);
|
||||
// 图片与描述信息之间需换行,否则无法预览图片
|
||||
result = "\n\n![" + name + "](" + path + ")";
|
||||
|
|
Loading…
Reference in New Issue