Authored by TaoHuang

fix(captcha): captcha verify

... ... @@ -49,11 +49,16 @@ module.exports = function(req, res, next) {
captchaReq.from_json_string(JSON.stringify(params));
// eslint-disable-next-line new-cap
client.DescribeCaptchaResult(captchaReq, function(errMsg) {
client.DescribeCaptchaResult(captchaReq, function(errMsg, response) {
if (errMsg) {
logger.error('tencent captcha fail ', req.user.uid);
return res.jsonp({ code: 400, message: errMsg.Message });
}
if (response.CaptchaCode !== 1) {
return res.jsonp({ code: 400, message: '验证码错误'});
}
next();
});
};
... ...