feat(接口定义): case或者场景名称中带/,保存性能测试报错的缺陷

--bug=1016355 --user=王孝刚 【接口测试】github#17452,接口自动化名字带 /
,转成性能测试保存会报错:文件上传失败 https://www.tapd.cn/55049933/s/1240778
This commit is contained in:
wxg0103 2022-09-08 15:09:08 +08:00 committed by fit2-zhao
parent 6615c6efd8
commit 6f25bbb90d
3 changed files with 11 additions and 6 deletions

View File

@ -3,6 +3,7 @@ package io.metersphere.api.dto;
import io.metersphere.base.domain.FileMetadata;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;
import java.util.List;
import java.util.Map;
@ -22,9 +23,14 @@ public class JmxInfoDTO {
private Map<String, String> attachFiles;
private List<FileMetadata> fileMetadataList;
public JmxInfoDTO(String name,String xml,Map<String, String> attachFiles){
this.name = name;
public JmxInfoDTO(String name, String xml, Map<String, String> attachFiles) {
this.name = StringUtils.replace(name, "/", "");
this.xml = xml;
this.attachFiles = attachFiles;
}
public void setName(String name) {
this.name = StringUtils.replace(name, "/", "");
}
}

View File

@ -3,6 +3,7 @@ package io.metersphere.api.dto.automation;
import io.metersphere.base.domain.FileMetadata;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang.StringUtils;
import java.util.List;
import java.util.Map;
@ -21,7 +22,8 @@ public class ApiScenarioExportJmxDTO {
private Map<String, List<String>> projectEnvMap;
public ApiScenarioExportJmxDTO(String name, String jmx) {
this.name = name;
this.name = StringUtils.replace(name, "/", "");
this.jmx = jmx;
}
}

View File

@ -143,9 +143,6 @@ export default {
let data = returnData.scenarioJmxList;
data.forEach(d => {
let jmxName = d.name + "_" + new Date().getTime() + ".jmx";
if (jmxName.indexOf("/") !== -1) {
jmxName = jmxName.replace(/\//g, "");
}
let threadGroups = findThreadGroup(d.jmx, jmxName);
threadGroups.forEach(tg => {
tg.options = {};