core: domain_join: add msg (fix #87)

This commit is contained in:
undefined committed 2021-07-20 23:04:59 +08:00
1 parent 42d48cc3d6
commit f38c749479
3 files changed
+5 -4

No files matched your search

+3 -2
View File
@@ -16,7 +16,7 @@ const Score = {
min: Math.min, min: Math.min,
}; };
function judgeCase(c, sid) { function judgeCase(c, sid: string) {
return async (ctx, ctxSubtask) => { return async (ctx, ctxSubtask) => {
if (ctx.config.template) { if (ctx.config.template) {
if (ctx.config.template[ctx.lang]) { 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) => { return async (ctx) => {
subtask.type = subtask.type || 'min'; subtask.type = subtask.type || 'min';
const ctxSubtask = { const ctxSubtask = {
@@ -173,6 +173,7 @@ export const judge = async (ctx) => {
if (ctx.failed[required.toString()]) effective = false; if (ctx.failed[required.toString()]) effective = false;
} }
if (effective) ctx.total_score += scores[sid]; if (effective) ctx.total_score += scores[sid];
console.log(effective, ctx.total_score, scores[sid], sid);
} }
ctx.stat.done = new Date(); ctx.stat.done = new Date();
if (process.env.DEV) ctx.next({ message: JSON.stringify(ctx.stat) }); if (process.env.DEV) ctx.next({ message: JSON.stringify(ctx.stat) });
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "hydrooj", "name": "hydrooj",
"version": "2.29.31", "version": "2.29.32",
"bin": "bin/hydrooj.js", "bin": "bin/hydrooj.js",
"main": "dist/loader.js", "main": "dist/loader.js",
"typings": "dist/loader.d.ts", "typings": "dist/loader.d.ts",
+1 -1
View File
@@ -288,7 +288,7 @@ class DomainJoinHandler extends Handler {
} }
} }
await domain.setUserRole(this.domain._id, this.user._id, this.joinSettings.role); 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.' } });
} }
} }