core&ui: fix contest problem ref

This commit is contained in:
undefined committed 2021-06-04 21:26:57 +08:00
1 parent 7a9dc95377
commit 715e564971
8 files changed
+10 -14

No files matched your search

+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "hydrooj",
"version": "2.28.17",
"version": "2.28.18",
"bin": "bin/hydrooj.js",
"main": "dist/loader.js",
"typings": "dist/loader.d.ts",
+3 -3
View File
@@ -74,10 +74,10 @@ export class ContestDetailHandler extends Handler {
['contest_main', 'contest_main'],
[tdoc.title, null, null, true],
];
const index = tdoc.pids.map((i) => i.toString());
for (const key in pdict) {
// @ts-ignore
if (pdict[key].domainId !== domainId) pdict[key].docId = `${pdict[key].domainId}:${pdict[key].docId}`;
pdict[key].pid = (tdoc.pids.indexOf(pdict[key].docId) + 10).toString(36).toUpperCase();
const i = (index.indexOf(key) + 10).toString(36).toUpperCase();
if (i !== '9') pdict[key].pid = i;
}
this.response.body = {
path, tdoc, tsdoc, attended, udict, pdict, psdict, rdict, page,
+3 -3
View File
@@ -90,10 +90,10 @@ class HomeworkDetailHandler extends Handler {
['homework_main', 'homework_main'],
[tdoc.title, null, null, true],
];
const index = tdoc.pids.map((i) => i.toString());
for (const key in pdict) {
// @ts-ignore
if (pdict[key].domainId !== domainId) pdict[key].docId = `${pdict[key].domainId}:${pdict[key].docId}`;
pdict[key].pid = (tdoc.pids.indexOf(pdict[key].docId) + 10).toString(36).toUpperCase();
const i = (index.indexOf(key) + 10).toString(36).toUpperCase();
if (i !== '9') pdict[key].pid = i;
}
this.response.template = 'homework_detail.html';
this.response.body = {
@@ -34,7 +34,6 @@ export async function parseConfig(config: string | ProblemConfigFile = {}) {
result.timeMax = result.timeMin = 1000;
}
if (cfg.langs) result.langs = cfg.langs;
console.log(result);
return result;
}
+1 -2
View File
@@ -17,7 +17,6 @@ import cache from 'koa-static-cache';
import sockjs from 'sockjs';
import cac from 'cac';
import { createHash } from 'crypto';
import type { SetOption } from 'cookies';
import * as bus from './bus';
import { errorMessage } from '../utils';
import { User, DomainDoc } from '../interface';
@@ -611,7 +610,7 @@ export class Handler extends HandlerCommon {
} else {
[, this.session] = await token.add(token.TYPE_SESSION, expireSeconds, { ...this.session, ...$update, ...$create });
}
const cookie: SetOption = {
const cookie = {
secure: !!system.get('session.secure'),
httpOnly: false,
};