Authored by 陈轩

Merge branch 'feature/captchapng' into release/5.2

... ... @@ -95,8 +95,21 @@ let verifyMobile = (req, res, next) => {
let mobile = +req.body.phoneNum;
let area = +(req.body.areaCode || 86);
let captcha = (req.body.captcha || '').trim();
let diffCaptcha = _.get(req.session, 'phoneReg.captcha');
if (captcha !== _.get(req.session, 'phoneReg.captcha')) {
// error case: 没有验证码
if (!diffCaptcha) {
return res.json({
code: 400,
message: '请求失败',
refreshCaptcha: true
});
}
delete req.session.phoneReg.captcha; // captcha 一次性
// error case: 验证码不匹配
if (captcha !== diffCaptcha) {
return res.json({
code: 400,
message: '校验码不正确',
... ...