diff --git a/modules/user.js b/modules/user.js index d14ccc6..ed6767a 100644 --- a/modules/user.js +++ b/modules/user.js @@ -152,6 +152,7 @@ app.post('/user/:id/edit', async (req, res) => { if (res.locals.user && await res.locals.user.hasPrivilege('manage_user')) { if (!syzoj.utils.isValidUsername(req.body.username)) throw new ErrorMessage('无效的用户名。'); user.username = req.body.username; + user.email = req.body.email; } if (res.locals.user && res.locals.user.is_admin) { @@ -165,7 +166,6 @@ app.post('/user/:id/edit', async (req, res) => { await user.setPrivileges(privileges); } - user.email = req.body.email; user.information = req.body.information; user.sex = req.body.sex; diff --git a/views/user_edit.ejs b/views/user_edit.ejs index 9e36aa4..379b7ba 100644 --- a/views/user_edit.ejs +++ b/views/user_edit.ejs @@ -23,7 +23,7 @@
- + readonly<% } %>>