Commit 064eadc3 authored by 陈志良's avatar 陈志良

Merge branch '0922_forum_share' into SANDBOX

parents af43ec62 da730ead
......@@ -100,7 +100,7 @@ router.get('/:ent_code/share.js', function(req, res, next) {
res.json(_.assign({result:false},returnCode.BUSY));
return;
}else{
if(forumInfo.share_type == 1){
if(forumInfo.share_type == 1 && forumInfo.share){
var shareInfo = forumInfo.share || {};
title = shareInfo.title,desc = shareInfo.description,imgUrl = shareInfo.icon;
}else{
......@@ -163,7 +163,7 @@ router.get('/:ent_code/share.js', function(req, res, next) {
desc = thread.content?thread.content.replace(/<\/?.+?>/g,"").replace(/&nbsp;/g,""):'';
imgUrl = thread.from.displayIcon || thread.from.icon || thread.info.icon;
//获取分享设置
if (!thread.share || thread.share_type==1) {
if (!thread.share || thread.share_type!==2) {
//获取默认文章分享
getWX(res, title, desc, link, imgUrl, mid,ent_code,thread._id,type,thread);
} else {
......@@ -354,18 +354,13 @@ router.get('/sharev2.js', function(req, res, next) {
imgUrl = thread.from.displayIcon || thread.from.icon || thread.info.icon;
link += baseParamsUrl;
//获取分享设置
if (!thread.share || thread.share_type==1) {
if (thread.share_type!==2) {
//文章默认分享
getWXV2(res, title, desc, link, imgUrl, mid,ent_code,thread._id,type,thread);
}else if(thread.share){
getWXV2(res, thread.share.title, thread.share.description, link, thread.share.icon, mid,ent_code,thread._id,type,thread);
} else {
//获取个性化文章分享设置
forumShareService.getById(thread.share, function(err, forumShare) {
if(err || !forumShare){
getWXV2(res, title, desc, link, imgUrl, mid,ent_code,thread._id,type,thread);
}else{
getWXV2(res, forumShare.title, forumShare.description, link, forumShare.icon, mid,ent_code,thread._id,type,thread);
}
});
getWXV2(res, title, desc, link, imgUrl, mid,ent_code,thread._id,type,thread);
}
}
}).fail(function(cont, err) {
......
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