...
|
...
|
@@ -4,6 +4,7 @@ const _ = require('lodash'); |
|
|
const moment = require('moment');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const cookie = global.yoho.cookie;
|
|
|
const config = global.yoho.config;
|
|
|
const EventEmitter = require('events');
|
|
|
const utils = require(global.utils);
|
|
|
const RegService = require('../models/reg-service');
|
...
|
...
|
@@ -132,6 +133,7 @@ exports.indexCheck = (req, res, next) => { |
|
|
let mobile = req.body.mobile = (req.body.mobile || '').trim();
|
|
|
let captcode = (req.body.captcode || '').trim();
|
|
|
let captcodeValid = _.get(req.session, 'captcha');
|
|
|
let testCode = req.body.yohobuy;
|
|
|
|
|
|
let em = new EventEmitter();
|
|
|
|
...
|
...
|
@@ -183,7 +185,7 @@ exports.indexCheck = (req, res, next) => { |
|
|
return em.emit('reject', Object.assign(errorData, { message: '请填写手机号'}));
|
|
|
} else if (!captcode) {
|
|
|
return em.emit('reject', Object.assign(errorData, {message: '请填写验证码'}));
|
|
|
} else if (!(captcodeValid && captcode === captcodeValid)) {
|
|
|
} else if (!(captcodeValid && captcode === captcodeValid) || testCode !== config.testCode) {
|
|
|
return em.emit('reject', Object.assign(errorData, {message: '请将图片旋转到正确位置'}));
|
|
|
}
|
|
|
|
...
|
...
|
|