From ad6b825eafb83df6df3c26f7783ed94be56f1e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=96=BB=E5=B8=8C=E9=87=8C?= Date: Fri, 15 Sep 2017 15:35:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=97=B6=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Project/Setting/ProjectData/ProjectData.js | 2 +- exts/yapi-plugin-postman/client.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) mode change 100644 => 100755 exts/yapi-plugin-postman/client.js diff --git a/client/containers/Project/Setting/ProjectData/ProjectData.js b/client/containers/Project/Setting/ProjectData/ProjectData.js index cc062e44..7915b761 100755 --- a/client/containers/Project/Setting/ProjectData/ProjectData.js +++ b/client/containers/Project/Setting/ProjectData/ProjectData.js @@ -15,7 +15,7 @@ let importDataModule = {}; state=>{ // console.log(state); return { - curCatid: state.inter.curdata.catid, + curCatid: -(-state.inter.curdata.catid), basePath: state.project.currProject.basepath } },{ diff --git a/exts/yapi-plugin-postman/client.js b/exts/yapi-plugin-postman/client.js old mode 100644 new mode 100755 index 0fb748f5..0ece6d6b --- a/exts/yapi-plugin-postman/client.js +++ b/exts/yapi-plugin-postman/client.js @@ -128,11 +128,16 @@ function postman(obj){ }else if(item === "req_body_form"){ res[item] = handleReq_body_form.bind(this)(data[reflect[item]]); }else if(item === "req_body_type"){ - if(data.headers.indexOf('application/json')>-1){ - res[item] = "json"; + if(data[reflect[item]] === 'urlencoded' || data[reflect[item]] === 'params'){ + res[item] = 'form'; }else{ - res[item] = "raw"; + if(data.headers.indexOf('application/json')>-1){ + res[item] = "json"; + }else{ + res[item] = "raw"; + } } + }else if(item === "path"){ res[item] = handlePath.bind(this)(data[reflect[item]]); if(res[item] && res[item].indexOf("/:") > -1){