...
|
...
|
@@ -17,7 +17,6 @@ const querystring = require('querystring'); |
|
|
* 首页文章列表 类型列表
|
|
|
*/
|
|
|
exports.index = (req, res, next) => {
|
|
|
|
|
|
let channel = req.yoho.channel;
|
|
|
let page = req.query.page || 1;
|
|
|
let pageSize = req.query.pageSize || 20;
|
...
|
...
|
@@ -37,7 +36,7 @@ exports.index = (req, res, next) => { |
|
|
guangModel.getRecoArticles(gender, 1, 10),
|
|
|
headerModel.requestHeaderData(channel)
|
|
|
]).then(ret => {
|
|
|
res.render('index', {
|
|
|
res.render('guang/index', {
|
|
|
guang: {
|
|
|
slider: ret[0],
|
|
|
msgTypes: ret[1],
|
...
|
...
|
@@ -88,7 +87,7 @@ exports.tags = (req, res, next) => { |
|
|
headerModel.requestHeaderData(channel)
|
|
|
]).then(ret => {
|
|
|
|
|
|
res.render('tag', {
|
|
|
res.render('guang/tag', {
|
|
|
title: query + (res.locals.title || ''),
|
|
|
guang: {
|
|
|
slider: ret[0],
|
...
|
...
|
@@ -138,7 +137,7 @@ exports.editor = (req, res, next) => { |
|
|
guangModel.getRecoArticles(gender, 1, 10),
|
|
|
headerModel.requestHeaderData(channel)
|
|
|
]).then(ret => {
|
|
|
res.render('editor', {
|
|
|
res.render('guang/editor', {
|
|
|
title: ret[0].name + (res.locals.title || ''),
|
|
|
guang: {
|
|
|
editor: ret[0],
|
...
|
...
|
@@ -183,7 +182,7 @@ exports.detail = (req, res, next) => { |
|
|
if (pjax) {
|
|
|
guangModel.getArticleComments(id, page, pageSize).then(ret => {
|
|
|
|
|
|
res.render('detail-comment', {
|
|
|
res.render('guang/detail-comment', {
|
|
|
layout: false,
|
|
|
comment: ret
|
|
|
}, function(err, html) {
|
...
|
...
|
@@ -236,7 +235,7 @@ exports.detail = (req, res, next) => { |
|
|
|
|
|
Promise.all(promises).then(ret => {
|
|
|
|
|
|
res.render('detail', Object.assign({
|
|
|
res.render('guang/detail', Object.assign({
|
|
|
module: 'guang',
|
|
|
page: 'detail',
|
|
|
headerData: ret[0].headerData,
|
...
|
...
|
@@ -351,7 +350,7 @@ exports.comment = (req, res) => { |
|
|
return guangModel.getArticleComments(id, 1, 20);
|
|
|
}).then(commentInfo => {
|
|
|
|
|
|
res.render('detail-comment', {
|
|
|
res.render('guang/detail-comment', {
|
|
|
comment: commentInfo,
|
|
|
layout: false
|
|
|
}, (err, content) => {
|
...
|
...
|
|