Commit 3926e6a1 authored by 陈志良's avatar 陈志良

新版 - 评论返回完整评论

parent 39c167aa
......@@ -447,8 +447,6 @@ router.post('/thread/:tid/share', function(req, res, next) {
//新增文章评论
router.post('/thread/:tid/comment/add', function(req, res, next) {
var userId = req.session.mobileForumUser.userId;
console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!');
var data = null;
forumLimitActionRefService.checkLimitActionProhibitionOfSpeech(userId, function(err, isProhibition){
if(err){
console.error(err);
......@@ -508,7 +506,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (err) {
callback(err, null);
} else {
data = newComment ;
var comments = thread.comments;
// console.log('=========');
// console.log(comments);
......@@ -522,9 +519,9 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
comments: array
}, function(err, result) {
if (err) {
callback(err, null);
callback(err, newComment);
} else {
callback(null, null);
callback(null, newComment);
}
});
}
......@@ -561,9 +558,17 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
}
}
});
forumCommentService.getPopulateCommentById(results[0]._id, function(err, c) {
if (err) {
res.json(returnCode.BUSY);
} else {
console.log(c);
var rs = {};
rs.data = data;
rs.data = c;
res.json(_.assign(rs, returnCode.SUCCESS));
}
});
}
});
......@@ -845,23 +850,16 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
}
}
});
// httpService.sendRequest(req.session.user.ent_code, req.session.openUser.mid, 'reply');
ForumComment.populate(results[0], {
path: 'from to',
select: 'uid nickName icon comments'
}, function(err, c) {
forumCommentService.getPopulateCommentById(results[0]._id, function(err, c) {
if (err) {
res.json(returnCode.BUSY);
} else {
var rs = {};
rs.data = results[0];
rs.data = c;
res.json(_.assign(rs, returnCode.SUCCESS));
}
});
// res.json(returnCode.SUCCESS);
}
});
}
......@@ -881,7 +879,6 @@ router.post('/thread/:tid/comment/:cid/create', function(req, res, next) {
}
});
});
//更改评论状态为3(删除)
router.post('/thread/:tid/comment/:cid/disable', function(req, res, next) {
var user_id = user.getMobileUser(req),
......
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