fix: --bug=1007357 --user=陈建星 【github

https://www.tapd.cn/55049933/s/1058304 fix 6987
This commit is contained in:
chenjianxing 2021-10-25 13:38:55 +08:00 committed by jianxing
parent 794945837f
commit 80492419a7
4 changed files with 24 additions and 2 deletions

View File

@ -238,7 +238,12 @@ public class ApiTestCaseService {
deleteFileByTestId(request.getId());
request.setBodyUploadIds(null);
ApiTestCase test = updateTest(request);
FileUtils.createBodyFiles(request.getId(), bodyFiles);
if (request.getRequest() != null) {
// requestID 跟接口id 不一致的情况
FileUtils.createBodyFiles(request.getRequest().getId(), bodyFiles);
} else {
FileUtils.createBodyFiles(request.getId(), bodyFiles);
}
return test;
}

View File

@ -234,6 +234,20 @@
this.$emit('saveApi', data);
});
},
handleSave() {
if (this.$refs.httpApi) {
this.$refs.httpApi.saveApi();
}
else if (this.$refs.tcpApi) {
this.$refs.tcpApi.saveApi();
}
else if (this.$refs.dubboApi) {
this.$refs.dubboApi.saveApi();
}
else if (this.$refs.sqlApi) {
this.$refs.sqlApi.saveApi();
}
},
setParameters(data) {
data.projectId = this.projectId;
this.request.name = this.currentApi.name;

View File

@ -111,7 +111,6 @@ import TcpMockConfig from "@/business/components/api/definition/components/mock/
import ApiCaseSimpleList from "./list/ApiCaseSimpleList";
import MsApiCaseList from "./case/ApiCaseList";
import {getUUID} from "@/common/js/utils";
import {Body} from "@/business/components/api/definition/model/ApiTestModel";
import {TYPE_TO_C} from "@/business/components/api/automation/scenario/Setting";
export default {
@ -252,6 +251,9 @@ export default {
this.$emit("refresh");
},
changeTab(tabType) {
if (this.$refs.apiConfig) {
this.$refs.apiConfig.handleSave();
}
this.refreshButtonActiveClass(tabType);
},
removeListener() {

View File

@ -57,6 +57,7 @@
}
},
upload(file) {
file.name = file.file.name;
this.parameter.files.push(file);
},
uploadValidate(file) {