From 1da2910eec0692a28fb8e0a9d51211a7270351ef Mon Sep 17 00:00:00 2001 From: suxiaoxin Date: Sat, 7 Oct 2017 07:05:54 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=8E=A5=E5=8F=A3=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/controllers/interface.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/controllers/interface.js b/server/controllers/interface.js index f4437367..026c7b47 100755 --- a/server/controllers/interface.js +++ b/server/controllers/interface.js @@ -218,8 +218,10 @@ class interfaceController extends baseController { yapi.emitHook('interface_get', params.id).then(); result = result.toObject(); - result.username = userinfo.username; - + if(userinfo){ + result.username = userinfo.username; + } + ctx.body = yapi.commons.resReturn(result); } catch (e) { ctx.body = yapi.commons.resReturn(null, 402, e.message);