mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core&ui: contest: add print (#1036)
Co-authored-by: panda <panda_dtdyy@outlook.com>
This commit is contained in:
1 parent
1c7b2275ff
commit
720eb6b7e0
13 files changed
+419
-6
No files matched your search
@@ -162,7 +162,9 @@ export class User {
|
||||
serialize(h) {
|
||||
if (!this._isPrivate) {
|
||||
const fields = ['_id', 'uname', 'mail', 'perm', 'role', 'priv', 'regat', 'loginat', 'tfa', 'authn'];
|
||||
if (h?.user?.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)) fields.push('displayName');
|
||||
if (h?.user?.hasPerm(PERM.PERM_VIEW_DISPLAYNAME)) {
|
||||
fields.push('displayName', 'school', 'studentId');
|
||||
}
|
||||
return pick(this, fields);
|
||||
}
|
||||
return JSON.stringify(this, serializer(true, h));
|
||||
|
||||
Reference in new issue
Block a user