Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
wenbo.dong 2017-09-15 15:57:36 +08:00
commit b072834509
2 changed files with 9 additions and 4 deletions

View File

@ -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
}
}, {

11
exts/yapi-plugin-postman/client.js Normal file → Executable file
View File

@ -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){