Authored by 郭成尧

superCapture

... ... @@ -39,6 +39,7 @@ passport.use(new LocalStrategy({
let from = req.cookies.from || 'yohobuy';
let udid = req.sessionID;
let captcha = req.body.captcha;
let superCapture = '';
if (isNaN(parseInt(area, 0)) || _.isEmpty(username) || _.isEmpty(password)) {
logger.info(`【Passport Loginbad params, area:${area} account:${username} password:${password}`);
... ... @@ -64,7 +65,8 @@ passport.use(new LocalStrategy({
let shoppingKey = cookie.getShoppingKey(req);
if (req.body.geetest_challenge) {
captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
captcha = '';
superCapture = config.superCapture;
}
req.ctx(AuthHelperModel).signinAes({
... ... @@ -76,7 +78,8 @@ passport.use(new LocalStrategy({
isSkip,
from,
udid,
degrees: captcha
degrees: captcha,
superCapture
}).then((result) => {
logger.info(`login result: ${JSON.stringify(result)}`);
... ...
... ... @@ -8,6 +8,7 @@
'use strict';
const helpers = global.yoho.helpers;
const config = global.yoho.config;
const RegServiceModel = require('../models/reg-service');
const BindServiceModel = require('../models/bind-service');
const AuthHelperModel = require('../models/auth-helper');
... ... @@ -129,16 +130,19 @@ const bind = {
let areaCode = req.body.areaCode || '86';
let udid = req.sessionID;
let captcha = req.body.captcha;
let superCapture = '';
if (req.xhr && _.isNumber(parseInt(phoneNum, 0)) && areaCode) {
if (req.body.geetest_challenge) {
captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
captcha = '';
superCapture = config.superCapture;
}
req.ctx(BindServiceModel).sendBindMsg({
area: areaCode,
mobile: phoneNum,
udid,
captcha
captcha,
superCapture
}).then(result => {
if (result && result.code) {
res.json(result);
... ...
... ... @@ -7,6 +7,7 @@ const sign = global.yoho.sign;
const co = require('bluebird').coroutine;
const cookie = global.yoho.cookie;
const AuthHelperModel = require('../models/auth-helper');
const config = global.yoho.config;
class Reg {
/**
... ... @@ -179,6 +180,7 @@ class Reg {
let inviteCode = req.body.inviteCode || '';
let udid = req.sessionID;
let captcha = req.body.captcha;
let superCapture = '';
// 判断参数是否合法
if (!_.isNumber(mobile) || !_.isNumber(area)) {
... ... @@ -187,12 +189,13 @@ class Reg {
}
if (req.body.geetest_challenge) {
captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
captcha = '';
superCapture = config.superCapture;
}
// 向手机发送注册验证码
req.ctx(RegServiceModel).sendCodeToMobile({
area, mobile, udid, captcha
area, mobile, udid, captcha, superCapture
}).then((result) => {
if (result.code !== 200) {
data.message = result.message;
... ...
... ... @@ -4,6 +4,7 @@ const _ = require('lodash');
const co = Promise.coroutine;
const moment = require('moment');
const cookie = global.yoho.cookie;
const config = global.yoho.config;
const utils = require(global.utils);
const RegServiceModel = require('../models/reg-service');
const PhoneServiceModel = require('../models/phone-service');
... ... @@ -81,7 +82,8 @@ class SmsLogin {
};
if (req.body.geetest_challenge) {
params.captcha = req.body.geetest_challenge; // TODO 使用极验证传特殊的值
params.captcha = '';
params.superCapture = config.superCapture;
}
co(function* () {
... ...
... ... @@ -43,7 +43,8 @@ class AuthModel extends global.yoho.BaseModel {
business_line: FROM[params.from].business_line,
udid: params.udid,
fromPage: PAGE,
degrees: params.degrees
degrees: params.degrees,
superCapture: params.superCapture
};
if (params.shoppingKey) {
... ...
... ... @@ -35,7 +35,8 @@ class BindServiceModel extends global.yoho.BaseModel {
area: params.area,
udid: params.udid,
degrees: params.captcha,
fromPage: PAGE
fromPage: PAGE,
superCapture: params.superCapture
}
});
}
... ...
... ... @@ -47,7 +47,8 @@ class PhoneServiceModel extends global.yoho.BaseModel {
type: params.type,
udid: params.udid,
fromPage: PAGE,
degrees: params.captcha
degrees: params.captcha,
superCapture: params.superCapture
}
});
}
... ...
... ... @@ -75,7 +75,8 @@ class RegServiceModel extends global.yoho.BaseModel {
mobile: params.mobile,
udid: params.udid,
fromPage: PAGE,
degrees: params.captcha
degrees: params.captcha,
superCapture: params.superCapture
}});
}
... ...
... ... @@ -128,7 +128,8 @@ module.exports = {
return Math.min(options.attempt * 100, 1000);
}
}
}
},
superCapture: '93c70db61fe276f93ce781ad17dc47cd'
};
if (isProduction) {
... ...