|
|
/**
|
|
|
* 登录判断
|
|
|
* YOHO授权登录
|
|
|
* @author: lq
|
|
|
* @date: 2017/9/1
|
|
|
*/
|
...
|
...
|
@@ -9,6 +9,7 @@ const moment = require('moment'); |
|
|
const authYoho = require('../../utils/authYoho');
|
|
|
const activityModel = require('../models/activity');
|
|
|
const queryString = require('queryString');
|
|
|
const isProd = process.env.NODE_ENV === 'production';
|
|
|
|
|
|
module.exports = (req, res, next) => {
|
|
|
const actId = req.query.actId;
|
...
|
...
|
@@ -21,9 +22,9 @@ module.exports = (req, res, next) => { |
|
|
|
|
|
if (!yhAuthId) {
|
|
|
let params = {
|
|
|
yh_backurl: 'http://action.yoho.cn/passport/yohoAuth',
|
|
|
yh_type: 'activity',
|
|
|
yh_time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss')
|
|
|
yh_time: moment(new Date()).format('YYYY-MM-DD HH:mm:ss'),
|
|
|
yh_backurl: `${isProd ? 'https' : 'http'}://action.yoho.cn/passport/yohoAuth`
|
|
|
};
|
|
|
|
|
|
params.yh_sign = authYoho.sign(params);
|
...
|
...
|
|