Authored by OF1706

Merge branch 'feature/shoppingCart' of http://git.yoho.cn/fe/yohobuy-node into feature/shoppingCart

@@ -60,11 +60,14 @@ const setShoppingCookie = (req, res) => { @@ -60,11 +60,14 @@ const setShoppingCookie = (req, res) => {
60 60
61 return service.getCartCount(uid, shoppingKey).then(ret => { 61 return service.getCartCount(uid, shoppingKey).then(ret => {
62 if (ret && ret.data && ret.data.cart_goods_count) { 62 if (ret && ret.data && ret.data.cart_goods_count) {
63 - res.cookie('_g', { 63 + res.cookie('_g', JSON.stringify({
64 _k: shoppingKey, 64 _k: shoppingKey,
65 _nac: ret.data.cart_goods_count, 65 _nac: ret.data.cart_goods_count,
66 _ac: 0, 66 _ac: 0,
67 _r: 1 67 _r: 1
  68 + }), {
  69 + domain: '.yohobuy.com',
  70 + path: '/'
68 }); 71 });
69 } 72 }
70 }); 73 });
@@ -368,10 +371,10 @@ const getRecommendProductAction = (req, res) => { @@ -368,10 +371,10 @@ const getRecommendProductAction = (req, res) => {
368 let channel = req.yoho.channel; 371 let channel = req.yoho.channel;
369 let uid = req.user.uid; 372 let uid = req.user.uid;
370 let udid = ghelper.getUdid(req, res); 373 let udid = ghelper.getUdid(req, res);
371 - let page = req.query.page || 1; 374 + let page = Number(req.query.page || 1);
372 let ret; 375 let ret;
373 376
374 - if (page === '6') { 377 + if (page <= 0 || page >= 6) {
375 page = 1; 378 page = 1;
376 } 379 }
377 380