mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: fix problem_main status cross-domain get
This commit is contained in:
1 parent
40c90c0574
commit
92c1a41585
5 files changed
+16
-8
No files matched your search
@@ -125,7 +125,7 @@ export class ProblemMainHandler extends ProblemHandler {
|
||||
this.response.template = 'problem_main.html';
|
||||
// eslint-disable-next-line @typescript-eslint/no-shadow
|
||||
const query: FilterQuery<ProblemDoc> = {};
|
||||
let psdict = {};
|
||||
const psdict = {};
|
||||
const search = global.Hydro.lib.problemSearch;
|
||||
let sort: string[];
|
||||
let fail = false;
|
||||
@@ -168,8 +168,13 @@ export class ProblemMainHandler extends ProblemHandler {
|
||||
}
|
||||
}
|
||||
if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) {
|
||||
psdict = await problem.getListStatus(
|
||||
domainId, this.user._id, pdocs.map((pdoc) => pdoc.docId),
|
||||
const domainIds = Array.from(new Set(pdocs.map((i) => i.domainId)));
|
||||
await Promise.all(
|
||||
domainIds.map((did) =>
|
||||
problem.getListStatus(
|
||||
did, this.user._id,
|
||||
pdocs.filter((i) => i.domainId === did).map((i) => i.docId),
|
||||
).then((res) => Object.assign(psdict, res))),
|
||||
);
|
||||
}
|
||||
this.response.body = {
|
||||
|
||||
Reference in new issue
Block a user