Commit b36eb6d4 authored by 刘文胜's avatar 刘文胜

Merge branch 'development' of git.wxpai.cn:scrmgroup/pisns-forum-api into development

parents b010731c 21a75806
......@@ -25,14 +25,15 @@ module.exports = function(app) {
//新增论坛文章
router.post('/thread/create', function(req, res, next) {
var rs = {};
req.body.ent_code=req.session.user.ent_code;
var uid=req.session.user.id;
// var uid='12345';
if(req.body.pid){
req.body.level = 2;
}
async.waterfall([
function(callback){
forumUserService.getUserByUid(uid,callback);
......@@ -129,8 +130,6 @@ router.post('/thread/:tid/update', function(req, res, next) {
if(err){
res.json(returnCode.BUSY);
}else{
console.log(thread);
console.log(fatherTitle);
res.json({message:"success",data:thread,title:fatherTitle});
}
});
......@@ -219,7 +218,6 @@ router.get('/threads/list', function(req, res, next) {
conditions.level = 2;
}
console.log(conditions);
forumThreadService.getAllThreadByFid(conditions,pageNo,pageSize,null,function(err,results){
if(err){
console.error(err);
......
......@@ -687,15 +687,9 @@ router.post('/thread/:tid/comment/:cid/delete', function(req, res, next) {
//评论列表
router.get('/thread/:tid/comment/list', function(req, res, next) {
<<<<<<< HEAD
var tid=req.params.tid || null;
var pageNo = req.query.pageNo || 1;
=======
var tid = req.params.tid || null;
var pageNo = req.query.pageNo || 1;
>>>>>>> f2a61e4b468be1158deee3015cb171b0bede90e4
var pageSize = req.query.pageSize || 10;
var conditions = {
......
......@@ -253,8 +253,8 @@ exports.getThreadById = function(tid, callback) {
//根据ID更新文章
exports.updateThreadById = function(tid, entity, callback) {
var shareEntity = entity.share || {};
if (entity.share && entity.share._id) {
var shareEntity = entity.share;
if (entity.share&&entity.share._id) {
entity.share = entity.share._id;
}else{
entity.share = '';
......@@ -283,7 +283,7 @@ exports.updateThreadById = function(tid, entity, callback) {
});
} else {
if (shareEntity.title || shareEntity.description || shareEntity.icon) {
if (shareEntity&&(shareEntity.title || shareEntity.description || shareEntity.icon)) {
shareEntity.ent_code = entity.ent_code;
var forumShare = new ForumShare(shareEntity);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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