...
|
...
|
@@ -35,6 +35,7 @@ exports.index = (req, res, next) => { |
|
|
Promise.all([
|
|
|
reqCtx.getBanner(channel),
|
|
|
reqCtx.getCategory(type, channel),
|
|
|
reqCtx.getTopList(gender, uid, udid, page, true),
|
|
|
reqCtx.getArticleList(gender, type, uid, udid, page, '', '', pageSize, channel, true),
|
|
|
reqCtx.getHotTags(page, pageSize, channel, isHotDegrade),
|
|
|
reqCtx.getAds(channel, isAdDegrade),
|
...
|
...
|
@@ -42,7 +43,7 @@ exports.index = (req, res, next) => { |
|
|
headerModel.requestHeaderData(channel)
|
|
|
]).then(ret => {
|
|
|
|
|
|
if (_.isEmpty(ret[2]) || _.isEmpty(ret[2].msgs)) {
|
|
|
if (_.get(ret[2], 'msgs') || _.get(ret[3], 'msgs')) {
|
|
|
res.set('Cache-Control', 'no-cache');
|
|
|
}
|
|
|
|
...
|
...
|
@@ -52,10 +53,11 @@ exports.index = (req, res, next) => { |
|
|
guang: {
|
|
|
slider: ret[0],
|
|
|
msgTypes: ret[1],
|
|
|
msgs: ret[2] && ret[2].msgs,
|
|
|
hotTags: ret[3],
|
|
|
ads: ret[4],
|
|
|
exRecos: ret[5],
|
|
|
msgs: (+type === 0 && +page === 1) ?
|
|
|
_.concat(ret[2] && ret[2].msgs, ret[3] && ret[3].msgs) : ret[3] && ret[3].msgs,
|
|
|
hotTags: ret[4],
|
|
|
ads: ret[6],
|
|
|
exRecos: ret[6],
|
|
|
|
|
|
guangIndexPage: true,
|
|
|
pageSize: pageSize,
|
...
|
...
|
@@ -63,11 +65,11 @@ exports.index = (req, res, next) => { |
|
|
pathNav: pathNav,
|
|
|
baseUrl: urlHelper.listUrl(channel, type),
|
|
|
page: page,
|
|
|
total: (ret[2] && ret[2].total) || 0
|
|
|
total: (ret[3] && ret[3].total) || 0
|
|
|
},
|
|
|
module: 'guang',
|
|
|
page: 'guang',
|
|
|
headerData: ret[6] && ret[6].headerData
|
|
|
headerData: ret[7] && ret[7].headerData
|
|
|
}));
|
|
|
}).catch(next);
|
|
|
|
...
|
...
|
@@ -215,7 +217,7 @@ exports.detail = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
if (pjax) {
|
|
|
req.ctx(guangModel).getArticleComments(id, page, pageSize).then(ret => {
|
|
|
req.ctx(guangModel).getArticleComments(uid, id, page, pageSize).then(ret => {
|
|
|
|
|
|
res.set('Cache-Control', 'no-cache');
|
|
|
res.render('guang/detail-comment', {
|
...
|
...
|
@@ -248,7 +250,7 @@ exports.detail = (req, res, next) => { |
|
|
headerModel.requestHeaderData(channel),
|
|
|
reqCtx.getArticleContent(id),
|
|
|
reqCtx.getHotTags(1, 20, channel, isHotDegrade),
|
|
|
reqCtx.getArticleComments(id, page, pageSize),
|
|
|
reqCtx.getArticleComments(uid, id, page, pageSize),
|
|
|
reqCtx.getArticleBaseInfo(id, uid, udid),
|
|
|
reqCtx.getArticleRelateBrand(id),
|
|
|
reqCtx.getRecoArticles(gender, 1, 10, channel),
|
...
|
...
|
@@ -390,7 +392,7 @@ exports.comment = (req, res) => { |
|
|
req.session['comment_' + udid] = null;
|
|
|
}
|
|
|
|
|
|
return req.ctx(guangModel).getArticleComments(id, 1, 20);
|
|
|
return req.ctx(guangModel).getArticleComments(uid, id, 1, 20);
|
|
|
}).then(commentInfo => {
|
|
|
|
|
|
res.render('guang/detail-comment', {
|
...
|
...
|
|