From f38c7494795a60adac50f186e5f92e2f6b815252 Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 20 Jul 2021 23:04:59 +0800 Subject: [PATCH] core: domain_join: add msg (fix #87) --- packages/hydrojudge/src/judge/default.ts | 5 +++-- packages/hydrooj/package.json | 2 +- packages/hydrooj/src/handler/domain.ts | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/src/judge/default.ts b/packages/hydrojudge/src/judge/default.ts index 45fb3bca7..66d498737 100644 --- a/packages/hydrojudge/src/judge/default.ts +++ b/packages/hydrojudge/src/judge/default.ts @@ -16,7 +16,7 @@ const Score = { min: Math.min, }; -function judgeCase(c, sid) { +function judgeCase(c, sid: string) { return async (ctx, ctxSubtask) => { if (ctx.config.template) { if (ctx.config.template[ctx.lang]) { @@ -105,7 +105,7 @@ function judgeCase(c, sid) { }; } -function judgeSubtask(subtask, sid) { +function judgeSubtask(subtask, sid: string) { return async (ctx) => { subtask.type = subtask.type || 'min'; const ctxSubtask = { @@ -173,6 +173,7 @@ export const judge = async (ctx) => { if (ctx.failed[required.toString()]) effective = false; } if (effective) ctx.total_score += scores[sid]; + console.log(effective, ctx.total_score, scores[sid], sid); } ctx.stat.done = new Date(); if (process.env.DEV) ctx.next({ message: JSON.stringify(ctx.stat) }); diff --git a/packages/hydrooj/package.json b/packages/hydrooj/package.json index c3c297843..79bb787e3 100644 --- a/packages/hydrooj/package.json +++ b/packages/hydrooj/package.json @@ -1,6 +1,6 @@ { "name": "hydrooj", - "version": "2.29.31", + "version": "2.29.32", "bin": "bin/hydrooj.js", "main": "dist/loader.js", "typings": "dist/loader.d.ts", diff --git a/packages/hydrooj/src/handler/domain.ts b/packages/hydrooj/src/handler/domain.ts index 046bc7af1..fcfebf016 100644 --- a/packages/hydrooj/src/handler/domain.ts +++ b/packages/hydrooj/src/handler/domain.ts @@ -288,7 +288,7 @@ class DomainJoinHandler extends Handler { } } await domain.setUserRole(this.domain._id, this.user._id, this.joinSettings.role); - this.response.redirect = this.url('domain_main', { query: { notification: 'Successfully joined domain.' } }); + this.response.redirect = this.url('homepage', { query: { notification: 'Successfully joined domain.' } }); } }