mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
题解功能
This commit is contained in:
1 parent
ec727d58aa
commit
41261f8c4b
20 files changed
+825
-1277
No files matched your search
+7
-1
@@ -33,6 +33,12 @@ async function getById(_id) {
|
||||
udoc.perm = role.perm;
|
||||
return new USER(udoc);
|
||||
}
|
||||
async function getList(uids) {
|
||||
let r = {};
|
||||
for (let uid of uids)
|
||||
r[uid] = await getById(uid);
|
||||
return r;
|
||||
}
|
||||
async function getByUname(uname) {
|
||||
let unameLower = uname.trim().toLowerCase();
|
||||
let udoc = await coll.findOne({ unameLower });
|
||||
@@ -112,5 +118,5 @@ module.exports = {
|
||||
changePassword, create, getByEmail,
|
||||
getById, getByUname, getMany,
|
||||
setById, setEmail,
|
||||
setPassword
|
||||
setPassword, getList
|
||||
};
|
||||
Reference in new issue
Block a user