Authored by ccbikai

代码格式化

@@ -79,4 +79,4 @@ require('./dispatch')(app); @@ -79,4 +79,4 @@ require('./dispatch')(app);
79 // listener 79 // listener
80 app.listen(config.port, function() { 80 app.listen(config.port, function() {
81 console.log('yohobuy start'); 81 console.log('yohobuy start');
82 -});  
  82 +});
@@ -14,11 +14,11 @@ const config = require('../../config/common'); @@ -14,11 +14,11 @@ 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'
22 }, (accessToken, refreshToken, profile, done) => { 22 }, (accessToken, refreshToken, profile, done) => {
23 done(null, profile); 23 done(null, profile);
24 -}));  
  24 +}));
@@ -66,4 +66,4 @@ const wechat = { @@ -66,4 +66,4 @@ const wechat = {
66 } 66 }
67 }; 67 };
68 68
69 -exports.wechat = wechat;  
  69 +exports.wechat = wechat;
@@ -37,4 +37,4 @@ app.use(passport.session()); @@ -37,4 +37,4 @@ app.use(passport.session());
37 // router 37 // router
38 app.use(require('./router')); 38 app.use(require('./router'));
39 39
40 -module.exports = app;  
  40 +module.exports = app;
@@ -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
@@ -44,4 +48,4 @@ class Auth { @@ -44,4 +48,4 @@ class Auth {
44 } 48 }
45 } 49 }
46 50
47 -module.exports = Auth;  
  51 +module.exports = Auth;
@@ -15,4 +15,4 @@ const router = express.Router(); // eslint-disable-line @@ -15,4 +15,4 @@ const router = express.Router(); // eslint-disable-line
15 router.get('/login/wechat', login.wechat.beforeLogin, login.wechat.login); // 登录 15 router.get('/login/wechat', login.wechat.beforeLogin, login.wechat.login); // 登录
16 router.get('/login/wechat/callback', login.wechat.callback); 16 router.get('/login/wechat/callback', login.wechat.callback);
17 17
18 -module.exports = router;  
  18 +module.exports = router;
@@ -48,9 +48,11 @@ module.exports = { @@ -48,9 +48,11 @@ module.exports = {
48 prettyPrint: true 48 prettyPrint: true
49 } 49 }
50 }, 50 },
51 - wechat: {  
52 - appID: 'wx3ae21dcbb82ad672',  
53 - appSecret: 'e78afb2321e6a19085767e1a0f0d52c1' 51 + thirdLogin: {
  52 + wechat: {
  53 + appID: 'wx3ae21dcbb82ad672',
  54 + appSecret: 'e78afb2321e6a19085767e1a0f0d52c1'
  55 + }
54 } 56 }
55 }; 57 };
56 58
@@ -76,4 +78,4 @@ if (isProduction) { @@ -76,4 +78,4 @@ if (isProduction) {
76 useOneapm: true, 78 useOneapm: true,
77 useCache: true 79 useCache: true
78 }); 80 });
79 -}  
  81 +}