diff --git a/modules/discussion.js b/modules/discussion.js index c700de3..bcc6d78 100644 --- a/modules/discussion.js +++ b/modules/discussion.js @@ -190,7 +190,7 @@ app.post('/article/:id/edit', async (req, res) => { article.title = req.body.title; article.content = req.body.content; article.update_time = time; - article.is_notice = res.locals.user && res.locals.user.is_admin && req.body.is_notice === 'on'; + article.is_notice = (res.locals.user && res.locals.user.is_admin ? req.body.is_notice === 'on' : article.is_notice); await article.save();