Authored by 陈轩

fix 验证码 修复逻辑错误

... ... @@ -187,7 +187,12 @@ const local = {
jsonData.changeCaptcha = true;
}
if (!(captchaInput && captchaCode && captchaInput === captchaCode) || testCode !== config.testCode) {
if (
!(
(captchaInput && captchaCode && captchaInput === captchaCode) ||
(testCode === config.testCode)
)
) {
res.json(jsonData);
return;
... ...
... ... @@ -185,7 +185,11 @@ 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) || testCode !== config.testCode) {
} else if (
!(
(captcodeValid && captcode === captcodeValid) || (testCode === config.testCode)
)
) {
return em.emit('reject', Object.assign(errorData, {message: '请将图片旋转到正确位置'}));
}
... ...