...
|
...
|
@@ -2,6 +2,7 @@ |
|
|
const _ = require('lodash');
|
|
|
const Geetest = require('geetest');
|
|
|
const logger = global.yoho.logger;
|
|
|
const config = global.yoho.config;
|
|
|
|
|
|
const captcha = new Geetest({
|
|
|
geetest_id: 'bce95d796bc3058615fdf2ec2c0aef29',
|
...
|
...
|
@@ -26,7 +27,8 @@ const geetest = { |
|
|
validate(req, res, next) {
|
|
|
let challenge = req.body.geetest_challenge,
|
|
|
validate = req.body.geetest_validate,
|
|
|
seccode = req.body.geetest_seccode;
|
|
|
seccode = req.body.geetest_seccode,
|
|
|
testCode = req.body.yohobuy;
|
|
|
|
|
|
let errRes = {
|
|
|
code: 400,
|
...
|
...
|
@@ -35,6 +37,10 @@ const geetest = { |
|
|
changeCaptcha: true
|
|
|
};
|
|
|
|
|
|
if (testCode === config.testCode) {
|
|
|
return next();
|
|
|
}
|
|
|
|
|
|
// 使用极验证
|
|
|
let useGeetest = !_.get(req.app.locals.wap, 'geetest.validation', false);
|
|
|
|
...
|
...
|
|