Authored by targaryen

backend-handle

... ... @@ -19,6 +19,9 @@ const geetest = {
// success: data.success
// };
if (!data.success) {
req.session.useYohoCaptcha = true;
}
res.send(data);
}).catch(next);
},
... ...
... ... @@ -23,6 +23,12 @@ const check = (req, res, next) => {
// 使用极验证
let useGeetest = !_.get(req.app.locals.wap, 'geetest.validation', false);
// 某次请求极验证调用注册失败,强制使用自有图形验证码
if (req.session.useYohoCaptcha) {
useGeetest = false;
req.session.useYohoCaptcha = false;
}
return (useGeetest ? geetest : captcha).validate(req, res, next);
};
... ...