From 1f1126306808baddd556c3b07fb0874299e625f7 Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Fri, 17 Sep 2021 15:49:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=9C=BA=E6=99=AF=E8=87=AA=E5=8A=A8?= =?UTF-8?q?=E5=8C=96)=20=E4=BF=AE=E5=A4=8D=E9=A1=B5=E9=9D=A2=E5=88=9D?= =?UTF-8?q?=E5=A7=8B=E5=8C=96=E6=97=B6=E6=8F=92=E4=BB=B6=E6=AD=A5=E9=AA=A4?= =?UTF-8?q?=E4=B8=8D=E5=8A=A0=E8=BD=BD=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../automation/scenario/EditApiScenario.vue | 34 +++++++++++-------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue index 206c9b1dcc..e319b125f9 100644 --- a/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue +++ b/frontend/src/business/components/api/automation/scenario/EditApiScenario.vue @@ -465,9 +465,10 @@ export default { this.getWsProjects(); this.getMaintainerOptions(); this.getApiScenario(); - this.getPlugins(); - this.initPlugins(); this.buttonData = buttons(this); + this.getPlugins().then(() => { + this.initPlugins(); + }); }, mounted() { this.$nextTick(() => { @@ -528,21 +529,24 @@ export default { } }, getPlugins() { - let url = "/plugin/list"; - this.plugins = []; - this.$get(url, response => { - let data = response.data; - if (data) { - data.forEach(item => { - if (item.license) { - if (hasLicense()) { + return new Promise((resolve) => { + let url = "/plugin/list"; + this.plugins = []; + this.$get(url, response => { + let data = response.data; + if (data) { + data.forEach(item => { + if (item.license) { + if (hasLicense()) { + this.plugins.push(item); + } + } else { this.plugins.push(item); } - } else { - this.plugins.push(item); - } - }) - } + }) + } + resolve(); + }); }); }, stop() {