Authored by htoooth

add comment

@@ -8,6 +8,7 @@ const captchaService = require('../models/captcha-service'); @@ -8,6 +8,7 @@ const captchaService = require('../models/captcha-service');
8 const helpers = global.yoho.helpers; 8 const helpers = global.yoho.helpers;
9 const CAPTCHA = 'yoho4946abcdef#$%&!@'; 9 const CAPTCHA = 'yoho4946abcdef#$%&!@';
10 10
  11 +// 对比函数
11 const _mustEqual = (req) => { 12 const _mustEqual = (req) => {
12 return req.body.verifyCode === req.session.captcha || 13 return req.body.verifyCode === req.session.captcha ||
13 req.body.verifyCode === CAPTCHA; 14 req.body.verifyCode === CAPTCHA;
@@ -78,6 +79,7 @@ const generate = (req, res, next) => { @@ -78,6 +79,7 @@ const generate = (req, res, next) => {
78 }).catch(next); 79 }).catch(next);
79 }; 80 };
80 81
  82 +// 端到端检查
81 const checkAPI = (req, res) => { 83 const checkAPI = (req, res) => {
82 let count = req.session.captchaCount; 84 let count = req.session.captchaCount;
83 85