...
|
...
|
@@ -3,10 +3,31 @@ |
|
|
* @author: Bi Kai<kai.bi@yoho.cn>
|
|
|
* @date: 2016/05/09
|
|
|
*/
|
|
|
'use strict';
|
|
|
const _ = require('lodash');
|
|
|
const channelModel = require('../models/channel');
|
|
|
var helpers = require('../../../library/helpers');
|
|
|
const helpers = require('../../../library/helpers');
|
|
|
|
|
|
const mod = 'channel';
|
|
|
let footerTab = {
|
|
|
indexUrl: helpers.url('/?go=1'), // 首页
|
|
|
categoryUrl: helpers.url('/cate'), // 分类
|
|
|
guangUrl: helpers.url('', null, 'guang'), // 逛首页
|
|
|
shoppingCartUrl: helpers.url('/cart/index/index'), // 购物车
|
|
|
mineUrl: helpers.url('/home') // 个人中心
|
|
|
};
|
|
|
|
|
|
exports.switchChannel = (req, res, next) => {
|
|
|
let channel = req.cookies._Channel;
|
|
|
|
|
|
if (req.query.go && channel) {
|
|
|
res.redirect('/' + channel);
|
|
|
} else {
|
|
|
// 设置浏览器缓存5分钟 300000ms
|
|
|
res.set('Expires', (new Date(_.now() + 300000)).toGMTString());
|
|
|
return next();
|
|
|
}
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 男生首页
|
...
|
...
|
@@ -19,9 +40,13 @@ exports.boys = (req, res) => { |
|
|
res.render('channel', Object.assign({
|
|
|
module: mod,
|
|
|
page: 'home',
|
|
|
title: '男生首页',
|
|
|
homeHeader: {
|
|
|
searchUrl: helpers.url('/search', null, 'search')
|
|
|
}
|
|
|
},
|
|
|
maybeLike: true,
|
|
|
showFooterTab: footerTab,
|
|
|
pageFooter: true
|
|
|
}, result));
|
|
|
});
|
|
|
}; |
...
|
...
|
|