Commit 289fb8af authored by 陈志良's avatar 陈志良

后台修改前端发布帖子限制更新内容

parent 87b7cf4b
...@@ -269,6 +269,27 @@ router.post('/thread/:tid/update', function(req, res, next) { ...@@ -269,6 +269,27 @@ router.post('/thread/:tid/update', function(req, res, next) {
delete req.body.father; delete req.body.father;
req.body.ent_code = req.session.user.ent_code; req.body.ent_code = req.session.user.ent_code;
if (tid) { if (tid) {
forumThreadService.getById(tid,function(err,doc){
if(err || !doc){
res.json(returnCode.WRONG_PARAM);
}
//如果修改的帖子为手机端发布的,则限制更新信息
if(doc.isPublishByBg == 0){
var body = req.body;
req.body = {};
if(body.status != null ){
req.body.status = body.status;
}
if(body.isEvent != null){
req.body.isEvent = body.isEvent;
if(body.event != null){
req.body.event = body.event;
}
}
if(body.tag != null){
req.body.tag = body.tag;
}
}
forumThreadService.updateThreadById(tid, req.body, function(err, thread) { forumThreadService.updateThreadById(tid, req.body, function(err, thread) {
if (err) { if (err) {
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
...@@ -283,6 +304,8 @@ router.post('/thread/:tid/update', function(req, res, next) { ...@@ -283,6 +304,8 @@ router.post('/thread/:tid/update', function(req, res, next) {
}); });
} }
}); });
});
} else { } else {
res.json(returnCode.WRONG_PARAM); res.json(returnCode.WRONG_PARAM);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment