Showing
4 changed files
with
10 additions
and
6 deletions
@@ -164,7 +164,7 @@ const component = { | @@ -164,7 +164,7 @@ const component = { | ||
164 | }); | 164 | }); |
165 | }, | 165 | }, |
166 | recordData: (req, res, next) => { | 166 | recordData: (req, res, next) => { |
167 | - let browserSkn = req.cookies._browseskn; | 167 | + let browserSkn = req.cookies._browseskn_h5; |
168 | let limit = req.query.limit; | 168 | let limit = req.query.limit; |
169 | 169 | ||
170 | // 拆解skn | 170 | // 拆解skn |
@@ -239,7 +239,7 @@ const component = { | @@ -239,7 +239,7 @@ const component = { | ||
239 | } | 239 | } |
240 | }, | 240 | }, |
241 | addRecords(req, res, next) { | 241 | addRecords(req, res, next) { |
242 | - let browserSkn = req.cookies._browseskn; | 242 | + let browserSkn = req.cookies._browseskn_h5; |
243 | 243 | ||
244 | if (!req.user.uid) { | 244 | if (!req.user.uid) { |
245 | res.json({ | 245 | res.json({ |
@@ -249,7 +249,7 @@ const component = { | @@ -249,7 +249,7 @@ const component = { | ||
249 | }); | 249 | }); |
250 | } else { | 250 | } else { |
251 | homeModel.addRecords(req.user.uid, req.sessionID, browserSkn).then(result => { | 251 | homeModel.addRecords(req.user.uid, req.sessionID, browserSkn).then(result => { |
252 | - res.cookie('_browseskn', '', { | 252 | + res.cookie('_browseskn_h5', '', { |
253 | maxAge: 0, | 253 | maxAge: 0, |
254 | domain: '.yohoblk.com' | 254 | domain: '.yohoblk.com' |
255 | }); | 255 | }); |
@@ -25,7 +25,7 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { | @@ -25,7 +25,7 @@ const saveRecentGoodInCookies = (oldSkns, res, addSkns) => { | ||
25 | oldSkns.unshift({product_skn: addSkns, time: (+new Date())}); | 25 | oldSkns.unshift({product_skn: addSkns, time: (+new Date())}); |
26 | 26 | ||
27 | // res.cookie('_browseskn', oldSkns.splice(0, 30).join(','), { | 27 | // res.cookie('_browseskn', oldSkns.splice(0, 30).join(','), { |
28 | - res.cookie('_browseskn', JSON.stringify(oldSkns.splice(0, 20)), { | 28 | + res.cookie('_browseskn_h5', JSON.stringify(oldSkns.splice(0, 20)), { |
29 | maxAge: 2000000000, | 29 | maxAge: 2000000000, |
30 | domain: '.yohoblk.com' | 30 | domain: '.yohoblk.com' |
31 | }); | 31 | }); |
@@ -59,7 +59,7 @@ const component = { | @@ -59,7 +59,7 @@ const component = { | ||
59 | model.product(params).then(result => { | 59 | model.product(params).then(result => { |
60 | // 最近浏览存储cookies | 60 | // 最近浏览存储cookies |
61 | if (_.has(result.data, 'product_skn') && !req.user.uid) { | 61 | if (_.has(result.data, 'product_skn') && !req.user.uid) { |
62 | - saveRecentGoodInCookies(req.cookies._browseskn, res, result.data.product_skn); | 62 | + saveRecentGoodInCookies(req.cookies._browseskn_h5, res, result.data.product_skn); |
63 | } | 63 | } |
64 | 64 | ||
65 | res.json(result); | 65 | res.json(result); |
@@ -125,7 +125,7 @@ | @@ -125,7 +125,7 @@ | ||
125 | $('#address').on('click', this.addressClick); | 125 | $('#address').on('click', this.addressClick); |
126 | 126 | ||
127 | // 之前是否有访客浏览 | 127 | // 之前是否有访客浏览 |
128 | - if (cookie.get('_browseskn')) { | 128 | + if (cookie.get('_browseskn_h5')) { |
129 | $.ajax({ | 129 | $.ajax({ |
130 | url: '/me/addRecords' | 130 | url: '/me/addRecords' |
131 | }).then(result => { | 131 | }).then(result => { |
-
Please register or login to post a comment