fix(接口测试): 修复新建case保存环境失败的缺陷

--bug=1021225 --user=王孝刚 【接口测试】新建接口用例,环境保存失败
https://www.tapd.cn/55049933/s/1319278
This commit is contained in:
wxg0103 2022-12-26 14:17:31 +08:00 committed by fit2-zhao
parent 9290f6a697
commit a7e994283c
2 changed files with 15 additions and 3 deletions

View File

@ -713,7 +713,7 @@ export default {
if (!hideAlert) {
this.$emit('refresh');
}
this.$emit('refreshCaseList');
this.$emit('refreshCaseList',row.id);
},
(error) => {
this.isSave = false;

View File

@ -437,8 +437,20 @@ export default {
refresh() {
this.$emit('refresh');
},
refreshCaseList() {
this.getApiTest(true, true);
refreshCaseList(id) {
return new Promise((resolve) => {
let commonUseEnvironment = store.useEnvironment;
this.environment = commonUseEnvironment ? commonUseEnvironment : '';
getCaseById(id).then((response) => {
let apiCase = response.data;
if (apiCase) {
this.formatCase(apiCase);
apiCase.active = true;
this.apiCaseList = [apiCase];
}
resolve();
});
});
},
reLoadCase() {
this.$emit('reLoadCase');