fix(接口定义): 修复导入接口个数不对,以及api和case判断错误 (#1659)

* feat(测试跟踪): 测试用例下载模版增加标签列

* fix(接口定义): 扩大请求头键长度

* fix: schedule表对旧数据name字段兼容的补充

* fix(接口定义): 修复导入接口个数不对,以及api和case判断错误
This commit is contained in:
Coooder-X 2021-03-18 14:49:39 +08:00 committed by GitHub
parent 1696001475
commit eb163bbb65
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -22,9 +22,9 @@ public class MsDefinitionParser extends MsAbstractParser<ApiDefinitionImport> {
String testStr = getApiTestStr(source); String testStr = getApiTestStr(source);
JSONObject testObject = JSONObject.parseObject(testStr, Feature.OrderedField); JSONObject testObject = JSONObject.parseObject(testStr, Feature.OrderedField);
this.projectId = request.getProjectId(); this.projectId = request.getProjectId();
if (testObject.get("projectName") != null || testObject.get("projectId") != null ) { if (testObject.get("projectName") != null || testObject.get("projectId") != null ) {// metersphere 格式导入
return parseMsFormat(testStr, request); return parseMsFormat(testStr, request);
} else { } else { // chrome 插件录制格式导入
request.setPlatform(ApiImportPlatform.Plugin.name()); request.setPlatform(ApiImportPlatform.Plugin.name());
ApiDefinitionImport apiImport = new ApiDefinitionImport(); ApiDefinitionImport apiImport = new ApiDefinitionImport();
apiImport.setProtocol(RequestType.HTTP); apiImport.setProtocol(RequestType.HTTP);

View File

@ -216,6 +216,7 @@ public class ApiDefinitionService {
ApiDefinitionExample example = new ApiDefinitionExample(); ApiDefinitionExample example = new ApiDefinitionExample();
if (request.getProtocol().equals(RequestType.HTTP)) { if (request.getProtocol().equals(RequestType.HTTP)) {
example.createCriteria().andMethodEqualTo(request.getMethod()).andStatusNotEqualTo("Trash") example.createCriteria().andMethodEqualTo(request.getMethod()).andStatusNotEqualTo("Trash")
.andPathEqualTo(request.getPath())
.andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId()); .andProjectIdEqualTo(request.getProjectId()).andIdNotEqualTo(request.getId());
return apiDefinitionMapper.selectByExample(example); return apiDefinitionMapper.selectByExample(example);
} else { } else {

View File

@ -240,7 +240,6 @@ import MsTabButton from "@/business/components/common/components/MsTabButton";
} }
}, },
methods: { methods: {
changeRedirectParam(redirectIDParam) { changeRedirectParam(redirectIDParam) {
this.redirectID = redirectIDParam; this.redirectID = redirectIDParam;
}, },
@ -349,7 +348,7 @@ import MsTabButton from "@/business/components/common/components/MsTabButton";
this.showCasePage = true; this.showCasePage = true;
}, },
exportAPI(type) { exportAPI(type) {
if (!this.isApiListEnable) { if (this.activeDom !== 'left') {
this.$warning('用例列表暂不支持导出,请切换成接口列表'); this.$warning('用例列表暂不支持导出,请切换成接口列表');
return; return;
} }