fix: 接口定义导出问题

This commit is contained in:
chenjianxing 2020-12-24 15:42:35 +08:00
parent d925e9cbac
commit bc585eeca4
1 changed files with 5 additions and 1 deletions

View File

@ -242,8 +242,12 @@
this.showCasePage = true; this.showCasePage = true;
}, },
exportAPI() { exportAPI() {
if (!this.isApiListEnable) {
this.$warning('用例列表暂不支持导出,请切换成接口列表');
return;
}
let obj = {projectName: getCurrentProjectID(), protocol: this.currentProtocol} let obj = {projectName: getCurrentProjectID(), protocol: this.currentProtocol}
if (this.$refs.apiList[0].selectRows && this.$refs.apiList[0].selectRows.length > 0) { if (this.$refs.apiList[0].selectRows && this.$refs.apiList[0].selectRows.size > 0) {
let arr = Array.from(this.$refs.apiList[0].selectRows); let arr = Array.from(this.$refs.apiList[0].selectRows);
obj.data = arr; obj.data = arr;
downloadFile("导出API.json", JSON.stringify(obj)); downloadFile("导出API.json", JSON.stringify(obj));