From f1a30fa071a08deae358c4db99eb54d065416dc1 Mon Sep 17 00:00:00 2001 From: "gaoxiaolin.gao" Date: Wed, 1 Aug 2018 16:04:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8E=BB=E6=8E=89=20json=20=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E7=A9=BA=E7=9A=84=E5=88=86=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- exts/yapi-plugin-export-data/controller.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/exts/yapi-plugin-export-data/controller.js b/exts/yapi-plugin-export-data/controller.js index 015f9a19..30f6a5ab 100644 --- a/exts/yapi-plugin-export-data/controller.js +++ b/exts/yapi-plugin-export-data/controller.js @@ -17,7 +17,7 @@ class exportController extends baseController { this.catModel = yapi.getInst(interfaceCatModel); this.interModel = yapi.getInst(interfaceModel); this.projectModel = yapi.getInst(projectModel); - // this.wikiModel = yapi.getInst(wikiModel); + } async handleListClass(pid, status) { @@ -29,10 +29,12 @@ class exportController extends baseController { list = list.sort((a, b) => { return a.index - b.index; }); - item.list = list; - newResult[i] = item; + if (list.length > 0) { + item.list = list; + newResult.push(item); + } } - + return newResult; } @@ -130,7 +132,7 @@ class exportController extends baseController { return ''; } ); - + return createHtml5(left || '', content); }