judge: update files api endpoint

This commit is contained in:
undefined committed 2024-01-04 17:38:30 +08:00
1 parent 2de1151b24
commit 3ede50a237
3 files changed
+10 -13

No files matched your search

+1 -1
View File
@@ -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);