...
|
...
|
@@ -10,6 +10,8 @@ const WeixinStrategy = require('passport-weixin-plus'); |
|
|
|
|
|
const config = require('../../config/common');
|
|
|
|
|
|
let siteUrl = config.siteUrl.indexOf('//') === 0 ? 'http:' + config.siteUrl : config.siteUrl;
|
|
|
|
|
|
/**
|
|
|
* wechat登录
|
|
|
*/
|
...
|
...
|
@@ -18,7 +20,7 @@ passport.use(new WeixinStrategy({ |
|
|
tokenURL: 'https://api.weixin.qq.com/sns/oauth2/access_token',
|
|
|
clientID: config.thirdLogin.wechat.appID,
|
|
|
clientSecret: config.thirdLogin.wechat.appSecret,
|
|
|
callbackURL: `${config.siteUrl}/passport/login/wechat/callback`,
|
|
|
callbackURL: `${siteUrl}/passport/login/wechat/callback`,
|
|
|
requireState: false,
|
|
|
scope: 'snsapi_userinfo'
|
|
|
}, (accessToken, refreshToken, profile, done) => {
|
...
|
...
|
|