mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
fix: 不存在的用户接口报错
This commit is contained in:
parent
2e000bb128
commit
72883a1a14
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user