Showing
2 changed files
with
9 additions
and
5 deletions
@@ -32,7 +32,7 @@ function doPassportCallback(openId, nickname, req, res) { | @@ -32,7 +32,7 @@ function doPassportCallback(openId, nickname, req, res) { | ||
32 | sourceType: 'wechat' | 32 | sourceType: 'wechat' |
33 | }); | 33 | }); |
34 | } else if (result.code === 200 && result.data.uid) { | 34 | } else if (result.code === 200 && result.data.uid) { |
35 | - return AuthHelper.syncUserSession(result.data.uid, res).then(() => { | 35 | + return AuthHelper.syncUserSession(result.data.uid, req, res).then(() => { |
36 | return refer; | 36 | return refer; |
37 | }); | 37 | }); |
38 | } | 38 | } |
@@ -68,4 +68,4 @@ const wechat = { | @@ -68,4 +68,4 @@ const wechat = { | ||
68 | } | 68 | } |
69 | }; | 69 | }; |
70 | 70 | ||
71 | -exports.wechat = wechat; | ||
71 | +exports.wechat = wechat; |
@@ -40,12 +40,16 @@ class Auth { | @@ -40,12 +40,16 @@ class Auth { | ||
40 | if (data) { | 40 | if (data) { |
41 | let uidCookie = `${data.profile_name}::${data.uid}::${data.vip_info.title}::${token}`; | 41 | let uidCookie = `${data.profile_name}::${data.uid}::${data.vip_info.title}::${token}`; |
42 | 42 | ||
43 | - res.cookies._UID = uidCookie; | 43 | + res.cookie('_UID', uidCookie, { |
44 | + domain: 'yohobuy.com' | ||
45 | + }); | ||
44 | } | 46 | } |
45 | req.session._TOKEN = token; // esline-disable-line | 47 | req.session._TOKEN = token; // esline-disable-line |
46 | req.session._LOGIN_UID = uid; // esline-disable-line | 48 | req.session._LOGIN_UID = uid; // esline-disable-line |
47 | - res.cookies._TOKEN = token; // esline-disable-line | ||
48 | - }); | 49 | + res.cookie('token', token, { |
50 | + domain: 'yohobuy.com' | ||
51 | + }); // esline-disable-line | ||
52 | + }).catch(console.log); | ||
49 | } | 53 | } |
50 | } | 54 | } |
51 | 55 |
-
Please register or login to post a comment