|
|
@ -328,9 +328,11 @@ app.post('/admin/other', async (req, res) => { |
|
|
|
} else if (req.body.type === 'reset_codelen') { |
|
|
|
} else if (req.body.type === 'reset_codelen') { |
|
|
|
const submissions = await JudgeState.query(); |
|
|
|
const submissions = await JudgeState.query(); |
|
|
|
for (const s of submissions) { |
|
|
|
for (const s of submissions) { |
|
|
|
|
|
|
|
if (s.type !== 'submit-answer') { |
|
|
|
s.code_length = s.code.length; |
|
|
|
s.code_length = s.code.length; |
|
|
|
await s.save(); |
|
|
|
await s.save(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
throw new ErrorMessage("操作类型不正确"); |
|
|
|
throw new ErrorMessage("操作类型不正确"); |
|
|
|
} |
|
|
|
} |
|
|
|