mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: key check report
This commit is contained in:
1 parent
cf4ef57f68
commit
132ef0312c
14 files changed
+38
-25
No files matched your search
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@hydrooj/vjudge",
|
||||
"version": "1.3.7",
|
||||
"version": "1.3.8",
|
||||
"description": "Submit problems to remote oj",
|
||||
"main": "package.json",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -19,7 +19,7 @@ declare module 'hydrooj/src/interface' {
|
||||
}
|
||||
}
|
||||
export interface IBasicProvider {
|
||||
ensureLogin(): Promise<boolean>;
|
||||
ensureLogin(): Promise<boolean | string>;
|
||||
getProblem(id: string): Promise<{
|
||||
title: string;
|
||||
data: Record<string, any>;
|
||||
|
||||
@@ -71,11 +71,11 @@ class Service {
|
||||
|
||||
async login() {
|
||||
const login = await this.api.ensureLogin();
|
||||
if (login) {
|
||||
if (login === true) {
|
||||
logger.info(`${this.account.type}/${this.account.handle}: logged in`);
|
||||
return true;
|
||||
}
|
||||
logger.warn(`${this.account.type}/${this.account.handle}: login fail`);
|
||||
logger.warn(`${this.account.type}/${this.account.handle}: login fail`, login || '');
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user