Commit ea22a43b authored by 陈志良's avatar 陈志良

去除打印

parent 37a1a073
...@@ -454,7 +454,7 @@ router.get('/info/:tid/comment/list', function(req, res, next) { ...@@ -454,7 +454,7 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
} }
forumCommentService.getAllCommentByThread(conditions, function(err, results) { forumCommentService.getAllCommentByThread(conditions, function(err, results) {
if (err) { if (err) {
console.log(err); console.error(err);
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
} else { } else {
var docs =[]; var docs =[];
...@@ -465,7 +465,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) { ...@@ -465,7 +465,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
if(doc.comments && doc.comments.length>0){//有子评论 if(doc.comments && doc.comments.length>0){//有子评论
var comments = []; var comments = [];
doc.comments.forEach(function(comment,j){ doc.comments.forEach(function(comment,j){
console.log((comment.from && comment.from._id == id),(comment.to && comment.to._id == id),id);
if((comment.from && comment.from._id == id) || (comment.to && comment.to._id == id)){ if((comment.from && comment.from._id == id) || (comment.to && comment.to._id == id)){
//二级评论的作者 或 被评论者是自己 //二级评论的作者 或 被评论者是自己
comments.push(comment); comments.push(comment);
...@@ -486,7 +485,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) { ...@@ -486,7 +485,6 @@ router.get('/info/:tid/comment/list', function(req, res, next) {
obj.pageNo=pageNo; obj.pageNo=pageNo;
obj.pageSize=pageSize; obj.pageSize=pageSize;
obj.items=docs.slice((pageNo-1>=0?pageNo-1:0)*pageSize,pageSize); obj.items=docs.slice((pageNo-1>=0?pageNo-1:0)*pageSize,pageSize);
console.log(obj.items);
res.json(_.assign(obj, returnCode.SUCCESS)); res.json(_.assign(obj, returnCode.SUCCESS));
} }
}); });
......
...@@ -520,7 +520,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -520,7 +520,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (content) { //评论不能为空 if (content) { //评论不能为空
//2.获取论坛文章 //2.获取论坛文章
forumThreadService.getThreadById(tid, function(err, thread) { forumThreadService.getThreadById(tid, function(err, thread) {
console.log(err);
if (err) { if (err) {
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
} else { } else {
...@@ -543,7 +542,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -543,7 +542,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
}; };
forumCommentService.count(conditions, function(err, count) { forumCommentService.count(conditions, function(err, count) {
if (err) { if (err) {
console.log(err);
callback(err, null); callback(err, null);
} else { } else {
// callback(null, count); // callback(null, count);
...@@ -560,9 +558,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -560,9 +558,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){}); forumThreadAttendService.threadAttend(thread._id,user.getMobileUser(req),function(err){});
} }
var comments = thread.comments; var comments = thread.comments;
// console.log('=========');
// console.log(comments);
// console.log('=========');
var array = []; var array = [];
if (comments && comments.items && comments.items.length > 0) { if (comments && comments.items && comments.items.length > 0) {
array = comments.items; array = comments.items;
...@@ -587,7 +582,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -587,7 +582,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (thread) { if (thread) {
forumThreadService.updateThreadCommentCountInc(tid, function(err, results) { forumThreadService.updateThreadCommentCountInc(tid, function(err, results) {
if (err) { if (err) {
console.log(err);
callback(err, null); callback(err, null);
} else { } else {
callback(null, null); callback(null, null);
...@@ -615,8 +609,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) { ...@@ -615,8 +609,6 @@ router.post('/thread/:tid/comment/add', function(req, res, next) {
if (err) { if (err) {
res.json(returnCode.BUSY); res.json(returnCode.BUSY);
} else { } else {
console.log(c);
var rs = {}; var rs = {};
rs.data = c; rs.data = c;
res.json(_.assign(rs, returnCode.SUCCESS)); res.json(_.assign(rs, returnCode.SUCCESS));
......
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