forked from github/dataease
Merge pull request #9593 from dataease/pr@dev-v2@fix_template-name
fix(工作台): 修复模版管理创建可视化资源可能因为url路径编码导致无法创建问题
This commit is contained in:
commit
bdee07da1c
@ -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);
|
||||
|
@ -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%`
|
||||
}
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user