Commit 16d2dc7c authored by 陈志良's avatar 陈志良

1

parent d062633c
......@@ -616,31 +616,36 @@ router.post('/thread/:tid/comment/create', function(req, res, next) {
});
//新增文章评论
router.post('/thread/:tid/comment/create/new', function(req, res, next) {
console.log('------------------in------------------');
var userId = req.session.mobileForumUser.userId;
forumLimitActionRefService.checkLimitActionProhibitionOfSpeech(userId, function(err, isProhibition){
console.log('1');
if(err){
console.error(err);
res.json(returnCode.PROHIBITION_OF_SPEECH);
}else{
console.log('2');
if(isProhibition){
res.json(returnCode.PROHIBITION_OF_SPEECH);
}else{
console.log('3');
var tid = req.params.tid || null;
if (tid) {
var integral = req.session.openUser.integral || 0;
var exp = req.session.openUser.exp || 0;
var destination = req.body.destination || '1';
//1.检查是否有权限
forumRolePermissionService.checkRolePermiss(req.session.user.ent_code, 'comment', integral, exp, function(err, result) {
if (err) {
console.error(err);
res.json(returnCode.BUSY);
} else {
if (result) { //有操作权限
// forumRolePermissionService.checkRolePermiss(req.session.user.ent_code, 'comment', integral, exp, function(err, result) {
// if (err) {
// console.error(err);
// res.json(returnCode.BUSY);
// } else {
// if (result) { //有操作权限
var content = req.body.content;
if (content) { //评论不能为空
//2.获取论坛文章
forumThreadService.getThreadById(tid, function(err, thread) {
console.log(err);
if (err) {
res.json(returnCode.BUSY);
} else {
......@@ -772,11 +777,11 @@ router.post('/thread/:tid/comment/create/new', function(req, res, next) {
} else {
res.json(returnCode.WRONG_PARAM);
}
} else {
res.json(returnCode.ACTION_NOT_PERMISSION);
}
}
});
// } else {
// res.json(returnCode.ACTION_NOT_PERMISSION);
// }
// }
// });
} else {
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