...
|
...
|
@@ -24,6 +24,8 @@ const headTab = [ |
|
|
}
|
|
|
];
|
|
|
|
|
|
let md5Str = '';
|
|
|
|
|
|
const processPublicData = (req, title) => {
|
|
|
let renderData = {
|
|
|
module: 'guang',
|
...
|
...
|
@@ -49,6 +51,7 @@ exports.index = (req, res, next) => { |
|
|
pageHeadTab[0].cur = true;
|
|
|
|
|
|
starModel.getIndexData().then((result) => {
|
|
|
md5Str = result.md5;
|
|
|
res.render('star/index', _.assign({
|
|
|
page: 'star',
|
|
|
isStarIndexPage: true,
|
...
|
...
|
@@ -58,22 +61,28 @@ exports.index = (req, res, next) => { |
|
|
data: result.ads
|
|
|
},
|
|
|
starAvatar: result.starAvatar ? result.starAvatar : '',
|
|
|
articles: result.articles
|
|
|
articles: result.articles,
|
|
|
md5: result.md5
|
|
|
}, processPublicData(req, '星潮教室')));
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
|
|
exports.getIndexHtml = (req, res, next) => {
|
|
|
starModel.getIndexData().then((result) => {
|
|
|
res.render('star/index-html', _.assign({
|
|
|
layout: false,
|
|
|
content: {
|
|
|
focus: true,
|
|
|
data: result.ads
|
|
|
},
|
|
|
starAvatar: result.starAvatar ? result.starAvatar : '',
|
|
|
articles: result.articles
|
|
|
}));
|
|
|
if (md5Str !== result.md5) {
|
|
|
res.render('star/index-html', _.assign({
|
|
|
layout: false,
|
|
|
content: {
|
|
|
focus: true,
|
|
|
data: result.ads
|
|
|
},
|
|
|
starAvatar: result.starAvatar ? result.starAvatar : '',
|
|
|
articles: result.articles
|
|
|
}));
|
|
|
} else {
|
|
|
res.json();
|
|
|
}
|
|
|
|
|
|
}).catch(next);
|
|
|
};
|
|
|
|
...
|
...
|
|