...
|
...
|
@@ -15,7 +15,7 @@ const isGeetest = (req) => { |
|
|
};
|
|
|
|
|
|
function required(req, res, next) {
|
|
|
img.trySwitch(req).then(() => {
|
|
|
img.trySwitch(req, res).then(() => {
|
|
|
if (req.session.captcha.type === CAPTCHA_TYPE.image && req.session.captcha.value === CAPTCHA_SWITCH.off) {
|
|
|
const captcha = {
|
|
|
type: CAPTCHA_TYPE.geetest,
|
...
|
...
|
@@ -23,7 +23,7 @@ function required(req, res, next) { |
|
|
};
|
|
|
|
|
|
req.session.captcha = captcha;
|
|
|
res.app.locals.captcha = captcha;
|
|
|
res.locals.captcha = captcha;
|
|
|
}
|
|
|
next();
|
|
|
}).catch(next);
|
...
|
...
|
@@ -62,7 +62,7 @@ const geeOnly = function(req, res, next) { |
|
|
};
|
|
|
|
|
|
req.session.captcha = captcha;
|
|
|
res.app.locals.captcha = captcha;
|
|
|
res.locals.captcha = captcha;
|
|
|
|
|
|
next();
|
|
|
};
|
...
|
...
|
|