...
|
...
|
@@ -25,7 +25,7 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { |
|
|
oldSkns.unshift({product_skn: addSkns, time: (+new Date())});
|
|
|
|
|
|
// res.cookie('_browseskn', oldSkns.splice(0, 30).join(','), {
|
|
|
res.cookie('_browseskn', JSON.stringify(oldSkns.splice(0, 20)), {
|
|
|
res.cookie('_browseskn_h5', JSON.stringify(oldSkns.splice(0, 20)), {
|
|
|
maxAge: 2000000000,
|
|
|
domain: '.yohoblk.com'
|
|
|
});
|
...
|
...
|
@@ -59,7 +59,7 @@ const component = { |
|
|
model.product(params).then(result => {
|
|
|
// 最近浏览存储cookies
|
|
|
if (_.has(result.data, 'product_skn') && !req.user.uid) {
|
|
|
saveRecentGoodInCookies(req.cookies._browseskn, res, result.data.product_skn);
|
|
|
saveRecentGoodInCookies(req.cookies._browseskn_h5, res, result.data.product_skn);
|
|
|
}
|
|
|
|
|
|
res.json(result);
|
...
|
...
|
|