mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
Google OAuth
This commit is contained in:
1 parent
8476eac3b4
commit
d2173eeb38
12 files changed
+261
-117
No files matched your search
@@ -1,6 +1,7 @@
|
||||
const assert = require('assert');
|
||||
|
||||
const { download, axios } = global.Hydro.lib;
|
||||
const { download } = global.Hydro.lib;
|
||||
const { superagent } = global.nodeModules;
|
||||
const { ValidationError, RemoteOnlineJudgeError } = global.Hydro.error;
|
||||
|
||||
async function syzoj(url, handler) {
|
||||
@@ -8,7 +9,7 @@ async function syzoj(url, handler) {
|
||||
assert(url.match(RE_SYZOJ), new ValidationError('url'));
|
||||
if (!url.endsWith('/')) url += '/';
|
||||
const [, host, pid] = RE_SYZOJ.exec(url);
|
||||
const res = await axios.get(`${url}export`);
|
||||
const res = await superagent.get(`${url}export`);
|
||||
assert(res.status === 200, new RemoteOnlineJudgeError('Cannot connect to target server'));
|
||||
assert(res.data.success, new RemoteOnlineJudgeError((res.data.error || {}).message));
|
||||
const p = res.data.obj;
|
||||
|
||||
Reference in new issue
Block a user