MCPcopy
hub / github.com/YMFE/yapi / getUserdata

Method getUserdata

server/controllers/group.js:199–213  ·  view source on GitHub ↗

* 获取用户数据 * @param uid * @param role * @returns {Promise.<*>}

(uid, role)

Source from the content-addressed store, hash-verified

197 */
198
199 async getUserdata(uid, role) {
200 role = role || 'dev';
201 let userInst = yapi.getInst(userModel);
202 let userData = await userInst.findById(uid);
203 if (!userData) {
204 return null;
205 }
206 return {
207 _role: userData.role,
208 role: role,
209 uid: userData._id,
210 username: userData.username,
211 email: userData.email
212 };
213 }
214
215 async getMyGroup(ctx){
216 var groupInst = yapi.getInst(groupModel);

Callers 8

addMethod · 0.95
addMemberMethod · 0.95
changeMemberRoleMethod · 0.95
delMemberMethod · 0.95
addMethod · 0.80
copyMethod · 0.80
addMemberMethod · 0.80
addMethod · 0.80

Calls 1

findByIdMethod · 0.45

Tested by

no test coverage detected