From 48e4b0806e4edf9bcc14283bac68e4da42da21aa Mon Sep 17 00:00:00 2001 From: chenjianxing Date: Thu, 28 Jan 2021 15:30:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=83=A8=E5=88=86=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E4=B8=A4=E4=B8=AA=E4=B8=8D=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=AA=97=E5=8F=A3=E4=B8=8D=E5=90=8CprojectId=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/definition/ApiDefinition.vue | 29 +++++++++++-------- .../api/definition/components/ApiConfig.vue | 3 +- .../components/runtest/RunTestDubboPage.vue | 8 ++--- .../components/runtest/RunTestHTTPPage.vue | 4 +-- .../components/runtest/RunTestSQLPage.vue | 8 ++--- .../components/runtest/RunTestTCPPage.vue | 4 +-- 6 files changed, 28 insertions(+), 28 deletions(-) diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index c872f3a654..b2492190de 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -59,6 +59,7 @@
@@ -76,14 +77,14 @@
- - - - + + + +
@@ -186,8 +187,12 @@ }], isApiListEnable: true, syncTabs: [], + projectId: "" } }, + mounted() { + this.projectId = getCurrentProjectID(); + }, watch: { currentProtocol() { this.handleCommand("CLOSE_ALL"); @@ -248,7 +253,7 @@ } }, handleTabAdd(e) { - if (!getCurrentProjectID()) { + if (!this.projectId) { this.$warning(this.$t('commons.check_project_tip')); return; } @@ -286,7 +291,7 @@ this.$refs.nodeTree.createRootModel(); }, handleTabsEdit(targetName, action, api) { - if (!getCurrentProjectID()) { + if (!this.projectId) { this.$warning(this.$t('commons.check_project_tip')); return; } @@ -325,7 +330,7 @@ this.$warning('用例列表暂不支持导出,请切换成接口列表'); return; } - let obj = {projectName: getCurrentProjectID(), protocol: this.currentProtocol} + let obj = {projectName: this.projectId, protocol: this.currentProtocol} if (this.$refs.apiList[0].selectRows && this.$refs.apiList[0].selectRows.size > 0) { let arr = Array.from(this.$refs.apiList[0].selectRows); obj.data = arr; @@ -339,7 +344,7 @@ ["status", ["Prepare", "Underway", "Completed"]], ] ); - condition.projectId = getCurrentProjectID(); + condition.projectId = this.projectId; this.$post(url, condition, response => { obj.data = response.data; this.buildApiPath(obj.data); diff --git a/frontend/src/business/components/api/definition/components/ApiConfig.vue b/frontend/src/business/components/api/definition/components/ApiConfig.vue index be68994833..235431817c 100644 --- a/frontend/src/business/components/api/definition/components/ApiConfig.vue +++ b/frontend/src/business/components/api/definition/components/ApiConfig.vue @@ -38,7 +38,6 @@ request: Sampler, config: {}, response: {}, - projectId: "", maintainerOptions: [], } }, @@ -47,9 +46,9 @@ moduleOptions: {}, currentProtocol: String, syncTabs: Array, + projectId: String }, created() { - this.projectId = getCurrentProjectID(); this.getMaintainerOptions(); switch (this.currentProtocol) { case Request.TYPES.SQL: diff --git a/frontend/src/business/components/api/definition/components/runtest/RunTestDubboPage.vue b/frontend/src/business/components/api/definition/components/runtest/RunTestDubboPage.vue index 8b1aa32bc4..1643d36bbb 100644 --- a/frontend/src/business/components/api/definition/components/runtest/RunTestDubboPage.vue +++ b/frontend/src/business/components/api/definition/components/runtest/RunTestDubboPage.vue @@ -44,7 +44,7 @@