Commit 5934f4f9 authored by 邓军's avatar 邓军

1.论坛子文章管理

2.调整个性化分享BUG
parent f2a61e4b
......@@ -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);
......
......@@ -254,7 +254,7 @@ exports.getThreadById = function(tid, callback) {
//根据ID更新文章
exports.updateThreadById = function(tid, entity, callback) {
var shareEntity = entity.share;
if (entity.share._id) {
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);
......
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