mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
judge: update files api endpoint
This commit is contained in:
3 files changed
+10
-13
No files matched your search
@@ -125,7 +125,7 @@ export default class Hydro implements Session {
|
||||
|
||||
async fetchFile(name: string) {
|
||||
name = name.split('#')[0];
|
||||
const res = await this.post('judge/code', { id: name });
|
||||
const res = await this.post('judge/files', { id: name });
|
||||
const target = path.join(getConfig('tmp_dir'), name.replace(/\//g, '_'));
|
||||
const w = fs.createWriteStream(target);
|
||||
this.get(res.body.url).pipe(w);
|
||||
|
||||
Reference in new issue
Block a user