fix(工作台): 修复模版管理创建可视化资源可能因为url路径编码导致无法创建问题

This commit is contained in:
wangjiahao 2024-05-10 17:19:13 +08:00
parent 23a0b49917
commit 6e32b7cf80
2 changed files with 7 additions and 1 deletions

View File

@ -23,6 +23,8 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -52,6 +54,8 @@ public class TemplateCenterManage {
*/
public TemplateManageFileDTO getTemplateFromMarket(String templateUrl) {
if (StringUtils.isNotEmpty(templateUrl)) {
String templateName = templateUrl.substring(templateUrl.lastIndexOf("/")+1,templateUrl.length());
templateUrl = templateUrl.replace(templateName,URLEncoder.encode(templateName, StandardCharsets.UTF_8).replace("+", "%20"));
String sufUrl = sysParameterManage.groupVal("template.").get("template.url");
String templateInfo = HttpClientUtil.get(sufUrl + templateUrl, null);
return JsonUtil.parseObject(templateInfo, TemplateManageFileDTO.class);

View File

@ -60,7 +60,9 @@ const classBackground = computed(() => {
return {
width: props.width + 'px',
height: props.width * 0.58 + 'px',
background: `url(${imgUrlTrans(thumbnailUrl.value)}) no-repeat`,
background: `url(${imgUrlTrans(thumbnailUrl.value)
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')}) no-repeat`,
'background-size': `100% 100%`
}
})