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
ce3d11b999
commit
b1153b641a
13 files changed
+163
-42
No files matched your search
@@ -89,6 +89,11 @@ async function changePassword(uid, currentPassword, newPassword) {
|
||||
$set: { salt, hash: pwhash.hash(newPassword, salt) },
|
||||
});
|
||||
}
|
||||
async function inc(_id, field, n) {
|
||||
await coll.findOneAndUpdate({ _id }, { $inc: { [field]: n } });
|
||||
const udoc = await getById(_id);
|
||||
return udoc;
|
||||
}
|
||||
async function create({
|
||||
uid, mail, uname, password, regip = '127.0.0.1', role = 'default',
|
||||
}) {
|
||||
@@ -129,6 +134,7 @@ module.exports = {
|
||||
getById,
|
||||
getByUname,
|
||||
getMany,
|
||||
inc,
|
||||
setById,
|
||||
setEmail,
|
||||
setPassword,
|
||||
|
||||
Reference in new issue
Block a user