1. async function() {
    2. const { ctx } = this;
    3. const {code} = ctx.request.query;
    4. // 通过用户关联,关联出用户名
    5. const res = AuthorizationCode.findById(code).populate('user');
    6. // 只返回用户名
    7. const res = AuthorizationCode.findById(code).populate('user', 'username');
    8. }