mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: login state check
This commit is contained in:
1 parent
03d096dc79
commit
3bcfec0366
4 files changed
+7
-3
No files matched your search
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/hydrojudge",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.10.12",
|
"version": "2.10.13",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -328,7 +328,7 @@ export default class Hydro {
|
|||||||
|
|
||||||
async ensureLogin() {
|
async ensureLogin() {
|
||||||
try {
|
try {
|
||||||
await this.axios.get('judge?check=true');
|
await this.axios.get('judge/files');
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
await this.login();
|
await this.login();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "2.33.1",
|
"version": "2.33.2",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -106,6 +106,10 @@ export async function end(body: JudgeResultBody) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export class JudgeFilesDownloadHandler extends Handler {
|
export class JudgeFilesDownloadHandler extends Handler {
|
||||||
|
async get() {
|
||||||
|
this.response.body = 'ok';
|
||||||
|
}
|
||||||
|
|
||||||
noCheckPermView = true;
|
noCheckPermView = true;
|
||||||
@post('files', Types.Set)
|
@post('files', Types.Set)
|
||||||
@post('pid', Types.UnsignedInt)
|
@post('pid', Types.UnsignedInt)
|
||||||
|
|||||||
Reference in new issue
Block a user