diff --git a/modules/admin.js b/modules/admin.js index 72673b9..25c87a2 100644 --- a/modules/admin.js +++ b/modules/admin.js @@ -325,6 +325,12 @@ app.post('/admin/other', async (req, res) => { for (const a of articles) { await a.resetReplyCountAndTime(); } + } else if (req.body.type === 'reset_codelen') { + const submissions = await JudgeState.query(); + for (const s of submissions) { + s.code_length = s.code.length; + await s.save(); + } } else { throw new ErrorMessage("操作类型不正确"); } diff --git a/views/admin_other.ejs b/views/admin_other.ejs index d0b1ef6..e422dd0 100644 --- a/views/admin_other.ejs +++ b/views/admin_other.ejs @@ -3,6 +3,6 @@

- +

<% include admin_footer %>