Authored by 陈轩

fix 验证码 修复逻辑错误

@@ -187,7 +187,12 @@ const local = { @@ -187,7 +187,12 @@ const local = {
187 jsonData.changeCaptcha = true; 187 jsonData.changeCaptcha = true;
188 } 188 }
189 189
190 - if (!(captchaInput && captchaCode && captchaInput === captchaCode) || testCode !== config.testCode) { 190 + if (
  191 + !(
  192 + (captchaInput && captchaCode && captchaInput === captchaCode) ||
  193 + (testCode === config.testCode)
  194 + )
  195 + ) {
191 res.json(jsonData); 196 res.json(jsonData);
192 197
193 return; 198 return;
@@ -185,7 +185,11 @@ exports.indexCheck = (req, res, next) => { @@ -185,7 +185,11 @@ exports.indexCheck = (req, res, next) => {
185 return em.emit('reject', Object.assign(errorData, { message: '请填写手机号'})); 185 return em.emit('reject', Object.assign(errorData, { message: '请填写手机号'}));
186 } else if (!captcode) { 186 } else if (!captcode) {
187 return em.emit('reject', Object.assign(errorData, {message: '请填写验证码'})); 187 return em.emit('reject', Object.assign(errorData, {message: '请填写验证码'}));
188 - } else if (!(captcodeValid && captcode === captcodeValid) || testCode !== config.testCode) { 188 + } else if (
  189 + !(
  190 + (captcodeValid && captcode === captcodeValid) || (testCode === config.testCode)
  191 + )
  192 + ) {
189 return em.emit('reject', Object.assign(errorData, {message: '请将图片旋转到正确位置'})); 193 return em.emit('reject', Object.assign(errorData, {message: '请将图片旋转到正确位置'}));
190 } 194 }
191 195