Showing
1 changed file
with
6 additions
and
6 deletions
@@ -68,16 +68,16 @@ let index = (req, res, next) => { | @@ -68,16 +68,16 @@ let index = (req, res, next) => { | ||
68 | * @return {Function} | 68 | * @return {Function} |
69 | */ | 69 | */ |
70 | let switchChannel = (req, res, next) => { | 70 | let switchChannel = (req, res, next) => { |
71 | - let channel = req.cookies._Channel; | 71 | + let channel = req.yoho.channel; |
72 | 72 | ||
73 | // 如果查询字符串设置了 go 参数,跳转到 cookie 中设置的频道页 | 73 | // 如果查询字符串设置了 go 参数,跳转到 cookie 中设置的频道页 |
74 | if (req.query.go && channel) { | 74 | if (req.query.go && channel) { |
75 | - res.redirect('/' + channel); | ||
76 | - } else { | ||
77 | - // 设置浏览器缓存5分钟 300000ms | ||
78 | - res.set('Expires', (new Date(_.now() + 300000)).toGMTString()); | ||
79 | - return next(); | 75 | + return res.redirect('/' + channel); |
80 | } | 76 | } |
77 | + | ||
78 | + // 设置浏览器缓存5分钟 300000ms | ||
79 | + res.set('Expires', (new Date(_.now() + 300000)).toGMTString()); | ||
80 | + next(); | ||
81 | }; | 81 | }; |
82 | 82 | ||
83 | /** | 83 | /** |
-
Please register or login to post a comment