diff --git a/packages/hydrooj/src/handler/problem.ts b/packages/hydrooj/src/handler/problem.ts index f27800b03..0d9ec9244 100644 --- a/packages/hydrooj/src/handler/problem.ts +++ b/packages/hydrooj/src/handler/problem.ts @@ -156,14 +156,10 @@ export class ProblemMainHandler extends Handler { if (sort.length) pdocs = pdocs.sort((a, b) => sort.indexOf(`${a.domainId}/${a.docId}`) - sort.indexOf(`${b.domainId}/${b.docId}`)); if (text && pcount > pdocs.length) pcount = pdocs.length; if (this.user.hasPriv(PRIV.PRIV_USER_PROFILE)) { - 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))), - ); + Object.assign(psdict, await problem.getListStatus( + domainId, this.user._id, + pdocs.map((i) => i.docId), + )); } if (pjax) { this.response.body = { diff --git a/packages/hydrooj/src/model/oplog.ts b/packages/hydrooj/src/model/oplog.ts index 7dd10aaa5..14320f4fe 100644 --- a/packages/hydrooj/src/model/oplog.ts +++ b/packages/hydrooj/src/model/oplog.ts @@ -52,6 +52,7 @@ export async function log(handler: T, type: string, data: any args, operator: handler.user?._id, operateIp: handler.request.ip, + json: handler.request.json, }); return res.insertedId; } diff --git a/packages/ui-default/templates/partials/problem_list.html b/packages/ui-default/templates/partials/problem_list.html index fb305774e..259cc4df9 100644 --- a/packages/ui-default/templates/partials/problem_list.html +++ b/packages/ui-default/templates/partials/problem_list.html @@ -39,7 +39,7 @@ {%- for pdoc in pdocs -%} - {% set psdoc = psdict[pdoc.domainId + '#' + pdoc.docId] %} + {% set psdoc = psdict[pdoc.docId] %}