mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-21 05:19:42 +08:00
fix: 不存在的用户接口报错
This commit is contained in:
parent
045b521106
commit
1da2910eec
@ -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