Showing
3 changed files
with
13 additions
and
4 deletions
1 | /** | 1 | /** |
2 | - * 登录判断 | 2 | + * YOHO授权登录 |
3 | * @author: lq | 3 | * @author: lq |
4 | * @date: 2017/9/1 | 4 | * @date: 2017/9/1 |
5 | */ | 5 | */ |
@@ -9,6 +9,7 @@ const moment = require('moment'); | @@ -9,6 +9,7 @@ const moment = require('moment'); | ||
9 | const authYoho = require('../../utils/authYoho'); | 9 | const authYoho = require('../../utils/authYoho'); |
10 | const activityModel = require('../models/activity'); | 10 | const activityModel = require('../models/activity'); |
11 | const queryString = require('queryString'); | 11 | const queryString = require('queryString'); |
12 | +const isProd = process.env.NODE_ENV === 'production'; | ||
12 | 13 | ||
13 | module.exports = (req, res, next) => { | 14 | module.exports = (req, res, next) => { |
14 | const actId = req.query.actId; | 15 | const actId = req.query.actId; |
@@ -21,9 +22,9 @@ module.exports = (req, res, next) => { | @@ -21,9 +22,9 @@ module.exports = (req, res, next) => { | ||
21 | 22 | ||
22 | if (!yhAuthId) { | 23 | if (!yhAuthId) { |
23 | let params = { | 24 | let params = { |
24 | - yh_backurl: 'http://action.yoho.cn/passport/yohoAuth', | ||
25 | yh_type: 'activity', | 25 | yh_type: 'activity', |
26 | - yh_time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss') | 26 | + yh_time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'), |
27 | + yh_backurl: `${isProd ? 'https' : 'http'}://action.yoho.cn/passport/yohoAuth` | ||
27 | }; | 28 | }; |
28 | 29 | ||
29 | params.yh_sign = authYoho.sign(params); | 30 | params.yh_sign = authYoho.sign(params); |
migrations/20170904183150.sql
0 → 100644
-
Please register or login to post a comment