Authored by ccbikai

修改channel 获取方法

... ... @@ -68,16 +68,16 @@ let index = (req, res, next) => {
* @return {Function}
*/
let switchChannel = (req, res, next) => {
let channel = req.cookies._Channel;
let channel = req.yoho.channel;
// 如果查询字符串设置了 go 参数,跳转到 cookie 中设置的频道页
if (req.query.go && channel) {
res.redirect('/' + channel);
} else {
// 设置浏览器缓存5分钟 300000ms
res.set('Expires', (new Date(_.now() + 300000)).toGMTString());
return next();
return res.redirect('/' + channel);
}
// 设置浏览器缓存5分钟 300000ms
res.set('Expires', (new Date(_.now() + 300000)).toGMTString());
next();
};
/**
... ...