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.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() {