mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
修复discussion模块
This commit is contained in:
1 parent
2554cf660a
commit
33e277f28f
30 files changed
+2460
-187
No files matched your search
+3
-2
@@ -15,12 +15,13 @@ class USER {
|
||||
this.salt = user.salt;
|
||||
this.hash = user.hash;
|
||||
this.perm = user.perm;
|
||||
this.lang = user.language || 'zh_CN';
|
||||
this.viewLang = user.language || 'zh_CN';
|
||||
this.codeLang = user.codeLang || 'c';
|
||||
this.codeTemplate = user.codeTemplate || '';
|
||||
this.regat = user.regat;
|
||||
this.loginat = user.loginat;
|
||||
this.bio = user.bio || '';
|
||||
this.gravatar = user.gravatar || '';
|
||||
this.nAccept = user.nAccept || 0;
|
||||
this.nSubmit = user.nSubmit || 0;
|
||||
}
|
||||
@@ -144,7 +145,7 @@ async function getPrefixList(prefix, limit = 50) {
|
||||
async function setRole(uid, role) {
|
||||
const udoc = await getById(uid);
|
||||
return await Promise.all([
|
||||
coll.findOneAndUpdate({ _id: uid }, { role }),
|
||||
coll.findOneAndUpdate({ _id: uid }, { $set: { role } }),
|
||||
collRole.updateOne({ _id: udoc.role }, { $inc: { count: -1 } }),
|
||||
collRole.updateOne({ _id: role }, { $inc: { count: 1 } }),
|
||||
]);
|
||||
|
||||
Reference in new issue
Block a user