fix: 不存在的用户接口报错

This commit is contained in:
suxiaoxin 2017-10-07 07:05:54 +08:00
parent 045b521106
commit 1da2910eec

View File

@ -218,7 +218,9 @@ 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) {