From 8cd925662c382c413373919198e3c256aad8c22d Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Tue, 31 Jan 2023 16:13:41 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcase=E6=B7=BB=E5=8A=A0=E5=90=8E=E7=BD=AE?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=A4=9A=E6=AC=A1=E4=BF=9D=E5=AD=98?= =?UTF-8?q?=EF=BC=8C=E5=86=85=E5=AE=B9=E8=BF=98=E6=98=AF=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1022091 --user=王孝刚 【接口测试】github#21425,接口定义case,后置操作添加脚本,修改信息后仍是以前的结果 https://www.tapd.cn/55049933/s/1329383 --- .../automation/schedule/ScheduleMaintain.vue | 4 +++- .../definition/components/case/ApiCaseItem.vue | 4 +++- .../definition/components/case/EditApiCase.vue | 16 ---------------- .../components/complete/EditCompleteHTTPApi.vue | 4 +++- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/api-test/frontend/src/business/automation/schedule/ScheduleMaintain.vue b/api-test/frontend/src/business/automation/schedule/ScheduleMaintain.vue index 320a1b560b..81f11587f0 100644 --- a/api-test/frontend/src/business/automation/schedule/ScheduleMaintain.vue +++ b/api-test/frontend/src/business/automation/schedule/ScheduleMaintain.vue @@ -439,7 +439,9 @@ export default { close() { this.dialogVisible = false; this.form.cronValue = ''; - this.$refs['from'].resetFields(); + if (this.$refs['from']) { + this.$refs['from'].resetFields(); + } if (!this.schedule.value) { this.$refs.crontabResult.resultList = []; } diff --git a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue index 0ca77a8c6a..a890c80033 100644 --- a/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue +++ b/api-test/frontend/src/business/definition/components/case/ApiCaseItem.vue @@ -281,6 +281,7 @@ import { TYPE_TO_C } from '@/business/automation/scenario/Setting'; import ApiCaseHeader from './ApiCaseHeader'; import { deepClone } from 'metersphere-frontend/src/utils/tableUtils'; import { useApiStore } from '@/store'; +import {TokenKey} from "metersphere-frontend/src/utils/constants"; const store = useApiStore(); export default { @@ -700,6 +701,8 @@ export default { row.createTime = data.createTime; row.updateTime = data.updateTime; this.compare = []; + let user = JSON.parse(localStorage.getItem(TokenKey)); + row.updateUser = user.name; row.type = null; this.$success(this.$t('commons.save_success')); this.tagCount = 0; @@ -713,7 +716,6 @@ export default { if (!hideAlert) { this.$emit('refresh'); } - this.$emit('refreshCaseList',row.id); }, (error) => { this.isSave = false; diff --git a/api-test/frontend/src/business/definition/components/case/EditApiCase.vue b/api-test/frontend/src/business/definition/components/case/EditApiCase.vue index fc57686711..df50e22bd6 100644 --- a/api-test/frontend/src/business/definition/components/case/EditApiCase.vue +++ b/api-test/frontend/src/business/definition/components/case/EditApiCase.vue @@ -24,7 +24,6 @@ { - 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'); }, diff --git a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue index 49925e5366..8f15715e1b 100644 --- a/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue +++ b/api-test/frontend/src/business/definition/components/complete/EditCompleteHTTPApi.vue @@ -463,7 +463,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); }