fix(场景自动化) 修复页面初始化时插件步骤不加载问题

This commit is contained in:
fit2-zhao 2021-09-17 15:49:25 +08:00 committed by fit2-zhao
parent 7f768a7b92
commit 1f11263068
1 changed files with 19 additions and 15 deletions

View File

@ -465,9 +465,10 @@ export default {
this.getWsProjects(); this.getWsProjects();
this.getMaintainerOptions(); this.getMaintainerOptions();
this.getApiScenario(); this.getApiScenario();
this.getPlugins();
this.initPlugins();
this.buttonData = buttons(this); this.buttonData = buttons(this);
this.getPlugins().then(() => {
this.initPlugins();
});
}, },
mounted() { mounted() {
this.$nextTick(() => { this.$nextTick(() => {
@ -528,21 +529,24 @@ export default {
} }
}, },
getPlugins() { getPlugins() {
let url = "/plugin/list"; return new Promise((resolve) => {
this.plugins = []; let url = "/plugin/list";
this.$get(url, response => { this.plugins = [];
let data = response.data; this.$get(url, response => {
if (data) { let data = response.data;
data.forEach(item => { if (data) {
if (item.license) { data.forEach(item => {
if (hasLicense()) { if (item.license) {
if (hasLicense()) {
this.plugins.push(item);
}
} else {
this.plugins.push(item); this.plugins.push(item);
} }
} else { })
this.plugins.push(item); }
} resolve();
}) });
}
}); });
}, },
stop() { stop() {