用户详情页面

This commit is contained in:
masnn committed 2020-04-10 23:17:52 +08:00
1 parent 26c467f60f
commit 0e590ebe0d
4 files changed
+64 -214

No files matched your search

+6 -1
View File
@@ -1,7 +1,7 @@
const
system = require('./system'),
{ UserNotFoundError, UserAlreadyExistError } = require('../error'),
pwhash = require('./lib/pwhash'),
pwhash = require('../lib/pwhash'),
validator = require('../lib/validator'),
db = require('../service/db'),
coll = db.collection('user'),
@@ -18,6 +18,11 @@ class USER {
this.lang = 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.nAccept = user.nAccept || 0;
this.nSubmit = user.nSubmit || 0;
}
hasPerm(perm) {
return this.perm == '-' || (this.perm || '').includes(perm);