- {{api.url ===undefined ? "暂无路径" : api.url}}
+
+ {{api.path ===null ? " " : api.path}}
- {{$t('test_track.plan_view.case_count')}}:5
+ {{$t('test_track.plan_view.case_count')}}:{{apiCaseList.length}}
diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue
index c80d5b3e30..26a3c6f921 100644
--- a/frontend/src/business/components/api/definition/components/ApiConfig.vue
+++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue
@@ -4,7 +4,7 @@
+ v-if="currentProtocol === 'HTTP'"/>
@@ -21,7 +21,6 @@
components: {MsAddCompleteHttpApi},
data() {
return {
- reqType: Request.TYPES.HTTP,
reqUrl: "",
request: Sampler,
response: {},
@@ -56,7 +55,6 @@
}
if (this.currentApi != null && this.currentApi.id != null) {
this.reqUrl = "/api/definition/update";
- this.currentApi.url = this.request.path;
} else {
this.reqUrl = "/api/definition/create";
this.currentApi.id = getUUID().substring(0, 8);
@@ -64,10 +62,7 @@
},
methods: {
runTest(data) {
- data.projectId = this.currentProject.id;
- this.request.hashTree[0].headers = this.headers;
- data.request = this.request;
- data.response = this.response;
+ this.setParameters(data);
let bodyFiles = this.getBodyUploadFiles(data);
this.$fileUpload(this.reqUrl, null, bodyFiles, data, () => {
this.$success(this.$t('commons.save_success'));
@@ -88,10 +83,7 @@
}
},
saveApi(data) {
- data.projectId = this.currentProject.id;
- this.request.hashTree[0].headers = this.headers;
- data.request = this.request;
- data.response = this.response;
+ this.setParameters(data);
let bodyFiles = this.getBodyUploadFiles(data);
this.$fileUpload(this.reqUrl, null, bodyFiles, data, () => {
this.$success(this.$t('commons.save_success'));
@@ -100,6 +92,12 @@
});
},
+ setParameters(data) {
+ data.projectId = this.currentProject.id;
+ this.request.hashTree[0].headers = this.headers;
+ data.request = this.request;
+ data.response = this.response;
+ },
getBodyUploadFiles(data) {
let bodyUploadFiles = [];
data.bodyUploadIds = [];
diff --git a/frontend/src/business/components/api/definition/components/ApiList.vue b/frontend/src/business/components/api/definition/components/ApiList.vue
index 9bf2119de1..4153a8d929 100644
--- a/frontend/src/business/components/api/definition/components/ApiList.vue
+++ b/frontend/src/business/components/api/definition/components/ApiList.vue
@@ -44,10 +44,10 @@
-
-
-
-
+