diff --git a/packages/vjudge/src/providers/hustoj.ts b/packages/vjudge/src/providers/hustoj.ts index c71a58e17..8c2b8e841 100644 --- a/packages/vjudge/src/providers/hustoj.ts +++ b/packages/vjudge/src/providers/hustoj.ts @@ -168,12 +168,12 @@ export class HUSTOJ extends BasicFetcher implements IBasicProvider { // if (res.text.includes(this.config.submit.tooFrequent)) throw new TooFrequentError(); console.log(res.text); if (this.config.submit.noRefetch) { - return this.config.submit.rid.exec(res.text)[1]; + return res.text.match(this.config.submit.rid)[0].split('=')[1]; } const url = this.config.monit.endpoint.replace('{uid}', this.state.username).replace('{pid}', id); this.state.pid = id; const r = await this.get(url); - return this.config.submit.rid.exec(r.text)[1]; + return r.text.match(this.config.submit.rid)[0].split('=')[1]; } async waitForSubmission(rid, next, end) { @@ -381,7 +381,7 @@ export class YBTBAS extends YBT { codeField: 'source', extra: { submit: '提交', user_id: this.account.handle }, tooFrequent: '提交频繁啦!', - rid: /runidx=([0-9]+)/gmi, + rid: /runidx=([0-9]+)/mi, noRefetch: true, }; this.config.ceInfo = { @@ -402,7 +402,7 @@ export class BZOJ extends HUSTOJ { }; this.config.submit.tooFrequent = 'You should not submit more than twice in 10 seconds.....'; this.config.submit.rid = /Submit_Time<\/td><\/tr>\n
([\s\S]*?)<\/pre>/igm;
+ this.config.ceInfo.matcher = /([\s\S]*?)<\/pre>/im;
}
}
diff --git a/packages/vjudge/src/verdict.ts b/packages/vjudge/src/verdict.ts
index f867fef03..d0be54f21 100644
--- a/packages/vjudge/src/verdict.ts
+++ b/packages/vjudge/src/verdict.ts
@@ -40,6 +40,7 @@ export const VERDICT = new Proxy>({
SUBMIT_FAILED_TEMP: STATUS.STATUS_SYSTEM_ERROR,
// HustOJ
+ WAITING: STATUS.STATUS_WAITING,
等待: STATUS.STATUS_WAITING,
运行并评判: STATUS.STATUS_JUDGING,
正在评测中: STATUS.STATUS_JUDGING,
@@ -66,8 +67,8 @@ export const VERDICT = new Proxy>({
get(self, key) {
if (typeof key === 'symbol') return null;
key = normalize(key);
- if (STATUS[key]) return STATUS[key];
- if (self[key]) return self[key];
+ if (typeof STATUS[key] === 'number') return STATUS[key];
+ if (typeof self[key] === 'number') return self[key];
return null;
},
});