Showing
1 changed file
with
3 additions
and
1 deletions
@@ -10,6 +10,8 @@ const WeixinStrategy = require('passport-weixin-plus'); | @@ -10,6 +10,8 @@ const WeixinStrategy = require('passport-weixin-plus'); | ||
10 | 10 | ||
11 | const config = require('../../config/common'); | 11 | const config = require('../../config/common'); |
12 | 12 | ||
13 | +let siteUrl = config.siteUrl.indexOf('//') === 0 ? 'http:' + config.siteUrl : config.siteUrl; | ||
14 | + | ||
13 | /** | 15 | /** |
14 | * wechat登录 | 16 | * wechat登录 |
15 | */ | 17 | */ |
@@ -18,7 +20,7 @@ passport.use(new WeixinStrategy({ | @@ -18,7 +20,7 @@ passport.use(new WeixinStrategy({ | ||
18 | tokenURL: 'https://api.weixin.qq.com/sns/oauth2/access_token', | 20 | tokenURL: 'https://api.weixin.qq.com/sns/oauth2/access_token', |
19 | clientID: config.thirdLogin.wechat.appID, | 21 | clientID: config.thirdLogin.wechat.appID, |
20 | clientSecret: config.thirdLogin.wechat.appSecret, | 22 | clientSecret: config.thirdLogin.wechat.appSecret, |
21 | - callbackURL: `${config.siteUrl}/passport/login/wechat/callback`, | 23 | + callbackURL: `${siteUrl}/passport/login/wechat/callback`, |
22 | requireState: false, | 24 | requireState: false, |
23 | scope: 'snsapi_userinfo' | 25 | scope: 'snsapi_userinfo' |
24 | }, (accessToken, refreshToken, profile, done) => { | 26 | }, (accessToken, refreshToken, profile, done) => { |
-
Please register or login to post a comment