From 68002ee5710aa0dd662cd33d962ef4e9ae3652f2 Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Mon, 23 Oct 2017 15:23:00 +0800 Subject: [PATCH 1/2] opti: add mockServer error log --- server/middleware/mockServer.js | 1 + 1 file changed, 1 insertion(+) diff --git a/server/middleware/mockServer.js b/server/middleware/mockServer.js index 533fe91a..a9751fb6 100755 --- a/server/middleware/mockServer.js +++ b/server/middleware/mockServer.js @@ -145,6 +145,7 @@ module.exports = async (ctx, next) => { try{ res = Mock.mock(res); }catch(e){ + yapi.commons.log(e, 'error') res = res; } From 648adfa2501e61f23db41c8dcf63b0b31f5aee37 Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Mon, 23 Oct 2017 20:08:06 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=20=E5=9B=A0=E4=B8=AD=E9=97=B4=E4=BB=B6?= =?UTF-8?q?=E9=A1=BA=E5=BA=8F=E5=AF=BC=E8=87=B4=20mockServer=20=E6=8B=BF?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=20requestBody=20=E6=95=B0=E6=8D=AE=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/app.js b/server/app.js index ca6f803c..1dc405fc 100755 --- a/server/app.js +++ b/server/app.js @@ -21,8 +21,8 @@ let indexFile = process.argv[2] === 'dev' ? 'dev.html' : 'index.html'; const app = websockify(new Koa()); yapi.app = app; -app.use(mockServer); app.use(bodyParser({multipart: true})); +app.use(mockServer); app.use(router.routes()); app.use(router.allowedMethods());