|
|
|
@ -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; |
|
|
|
|
|
|
|
|
|