mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
vjudge: allow alternative endpoint
This commit is contained in:
1 parent
cc58aa667e
commit
8caa621d8b
3 files changed
+4
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hydrooj/vjudge",
|
"name": "@hydrooj/vjudge",
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"description": "Submit problems to remote oj",
|
"description": "Submit problems to remote oj",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ export interface RemoteAccount {
|
|||||||
cookie?: string[];
|
cookie?: string[];
|
||||||
handle: string;
|
handle: string;
|
||||||
password: string;
|
password: string;
|
||||||
|
endpoint?: string;
|
||||||
}
|
}
|
||||||
declare module 'hydrooj/dist/interface' {
|
declare module 'hydrooj/dist/interface' {
|
||||||
interface Collections {
|
interface Collections {
|
||||||
|
|||||||
@@ -38,12 +38,12 @@ export default class CodeforcesProvider implements IBasicProvider {
|
|||||||
|
|
||||||
get(url: string) {
|
get(url: string) {
|
||||||
logger.debug('get', url);
|
logger.debug('get', url);
|
||||||
return superagent.get(`https://codeforces.com${url}`).set('Cookie', this.cookie);
|
return superagent.get(`${this.account.endpoint || 'https://codeforces.com'}${url}`).set('Cookie', this.cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
post(url: string) {
|
post(url: string) {
|
||||||
logger.debug('post', url, this.cookie);
|
logger.debug('post', url, this.cookie);
|
||||||
return superagent.post(`https://codeforces.com${url}`).type('form').set('Cookie', this.cookie);
|
return superagent.post(`${this.account.endpoint || 'https://codeforces.com'}${url}`).type('form').set('Cookie', this.cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
tta(_39ce7: string) {
|
tta(_39ce7: string) {
|
||||||
|
|||||||
Reference in new issue
Block a user