mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
bug fix
This commit is contained in:
1 parent
688ccf811b
commit
775301c001
7 files changed
+56
-75
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "hydrooj",
|
||||
"version": "3.3.14",
|
||||
"version": "3.3.15",
|
||||
"bin": "bin/hydrooj.js",
|
||||
"main": "src/loader",
|
||||
"module": "src/loader",
|
||||
|
||||
@@ -301,15 +301,17 @@ class UserDetailHandler extends Handler {
|
||||
const pdocs: ProblemDoc[] = [];
|
||||
const acInfo: Record<string, number> = {};
|
||||
const canViewHidden = this.user.hasPerm(PERM.PERM_VIEW_PROBLEM_HIDDEN) || this.user._id;
|
||||
await Promise.all([domainId, ...(union?.union || [])].map(async (did) => {
|
||||
const psdocs = await problem.getMultiStatus(did, { uid, status: STATUS.STATUS_ACCEPTED }).toArray();
|
||||
pdocs.push(...Object.values(
|
||||
await problem.getList(
|
||||
did, psdocs.map((i) => i.docId), canViewHidden,
|
||||
this.user.group, false, undefined, true,
|
||||
),
|
||||
));
|
||||
}));
|
||||
if (this.user.hasPerm(PERM.PERM_VIEW_PROBLEM)) {
|
||||
await Promise.all([domainId, ...(union?.union || [])].map(async (did) => {
|
||||
const psdocs = await problem.getMultiStatus(did, { uid, status: STATUS.STATUS_ACCEPTED }).toArray();
|
||||
pdocs.push(...Object.values(
|
||||
await problem.getList(
|
||||
did, psdocs.map((i) => i.docId), canViewHidden,
|
||||
this.user.group, false, problem.PROJECTION_LIST, true,
|
||||
),
|
||||
));
|
||||
}));
|
||||
}
|
||||
for (const pdoc of pdocs) {
|
||||
for (const tag of pdoc.tag) {
|
||||
if (acInfo[tag]) acInfo[tag]++;
|
||||
|
||||
Reference in new issue
Block a user