refactor(接口定义): 优化case保存后更新人没有变化的方法

This commit is contained in:
wxg0103 2023-01-31 18:10:13 +08:00 committed by wxg0103
parent f499750564
commit 3a04deccff
3 changed files with 4 additions and 18 deletions

View File

@ -592,6 +592,7 @@ export default {
row.createTime = data.createTime;
row.updateTime = data.updateTime;
this.compare = [];
row.updateUser = getCurrentUser().name;
row.type = null;
this.$success(this.$t('commons.save_success'));
this.tagCount = 0;
@ -605,7 +606,6 @@ export default {
if (!hideAlert) {
this.$emit('refresh');
}
this.$emit('refreshCaseList',row.id);
}, (error) => {
this.isSave = false;
});

View File

@ -22,7 +22,6 @@
<api-case-item
:loading="singleLoading && singleRunId ===item.id || batchLoadingIds.indexOf(item.id) > -1"
@refresh="refresh"
@refreshCaseList="refreshCaseList"
@singleRun="singleRun"
@stop="stop"
@refreshModule="refreshModule"
@ -411,21 +410,6 @@ export default {
refresh() {
this.$emit('refresh');
},
refreshCaseList(id) {
return new Promise((resolve) => {
let commonUseEnvironment = this.$store.state.useEnvironment;
this.environment = commonUseEnvironment ? commonUseEnvironment : "";
this.result = this.$get("/api/testcase/findById/" + id, response => {
let apiCase = response.data;
if (apiCase) {
this.formatCase(apiCase);
apiCase.active = true;
this.apiCaseList = [apiCase];
}
resolve();
});
});
},
reLoadCase() {
this.$emit('reLoadCase');
},

View File

@ -458,7 +458,9 @@ export default {
setParameter() {
this.request.path = this.httpForm.path;
this.request.method = this.httpForm.method;
this.httpForm.request.useEnvironment = undefined;
if (this.httpForm && this.httpForm.request) {
this.httpForm.request.useEnvironment = undefined;
}
if (this.httpForm.tags instanceof Array) {
this.httpForm.tags = JSON.stringify(this.httpForm.tags);
}