fix: 容错性修复,防止mockjs parse error导致的问题

This commit is contained in:
suxiaoxin 2017-10-19 17:35:09 +08:00
parent 28e686a287
commit fa06da8cd2
2 changed files with 8 additions and 1 deletions

View File

@ -45,6 +45,7 @@ YApi 是<strong>高效</strong>、<strong>易用</strong>、<strong>功能强大
* 去哪儿
* 唯品支付
* 链家网
* 快手
* 中山市鲣鸟网络科技有限公司
* 广州大象健康科技有限公司
* 杭州数慧科技有限公司

View File

@ -138,7 +138,13 @@ module.exports = async (ctx, next) => {
body: ctx.request.body
}
);
res = Mock.mock(res);
try{
res = Mock.mock(res);
}catch(e){
res = res;
}
let context = {
projectData: project,
interfaceData: interfaceData,