Showing
7 changed files
with
8 additions
and
2 deletions
@@ -14,8 +14,8 @@ const config = require('../../config/common'); | @@ -14,8 +14,8 @@ const config = require('../../config/common'); | ||
14 | * wechat登录 | 14 | * wechat登录 |
15 | */ | 15 | */ |
16 | passport.use(new WeixinStrategy({ | 16 | passport.use(new WeixinStrategy({ |
17 | - clientID: config.wechat.appID, | ||
18 | - clientSecret: config.wechat.appSecret, | 17 | + clientID: config.thirdLogin.wechat.appID, |
18 | + clientSecret: config.thirdLogin.wechat.appSecret, | ||
19 | callbackURL: `${config.siteUrl}/passport/login/wechat/callback`, | 19 | callbackURL: `${config.siteUrl}/passport/login/wechat/callback`, |
20 | requireState: false, | 20 | requireState: false, |
21 | scope: 'snsapi_userinfo' | 21 | scope: 'snsapi_userinfo' |
@@ -15,6 +15,10 @@ class Auth { | @@ -15,6 +15,10 @@ class Auth { | ||
15 | method: 'app.passport.signinByOpenID' | 15 | method: 'app.passport.signinByOpenID' |
16 | }; | 16 | }; |
17 | 17 | ||
18 | + if (shoppingKey) { | ||
19 | + param.shopping_key = shoppingKey; | ||
20 | + } | ||
21 | + | ||
18 | return api.get('', sign.apiSign(param)); | 22 | return api.get('', sign.apiSign(param)); |
19 | } | 23 | } |
20 | 24 |
@@ -48,10 +48,12 @@ module.exports = { | @@ -48,10 +48,12 @@ module.exports = { | ||
48 | prettyPrint: true | 48 | prettyPrint: true |
49 | } | 49 | } |
50 | }, | 50 | }, |
51 | + thirdLogin: { | ||
51 | wechat: { | 52 | wechat: { |
52 | appID: 'wx3ae21dcbb82ad672', | 53 | appID: 'wx3ae21dcbb82ad672', |
53 | appSecret: 'e78afb2321e6a19085767e1a0f0d52c1' | 54 | appSecret: 'e78afb2321e6a19085767e1a0f0d52c1' |
54 | } | 55 | } |
56 | + } | ||
55 | }; | 57 | }; |
56 | 58 | ||
57 | if (isProduction) { | 59 | if (isProduction) { |
-
Please register or login to post a comment