...
|
...
|
@@ -550,7 +550,16 @@ exports.loginShowCaptchaByIp = function(req, res, next) { |
|
|
req.yoho.captchaShow = false;
|
|
|
}
|
|
|
|
|
|
co(function*() {
|
|
|
// 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
|
|
|
let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'open.firstLoginShowCaptcha', false);
|
|
|
|
|
|
if (firstLoginShowCaptcha) {
|
|
|
// 因撞库,每次都展示
|
|
|
req.yoho.captchaShow = true;
|
|
|
return next();
|
|
|
} else {
|
|
|
// 勿删,可能要改回来
|
|
|
co(function* () {
|
|
|
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
|
|
|
|
|
|
log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
|
...
|
...
|
@@ -563,6 +572,7 @@ exports.loginShowCaptchaByIp = function(req, res, next) { |
|
|
req.yoho.captchaShow = true;
|
|
|
next();
|
|
|
});
|
|
|
}
|
|
|
};
|
|
|
|
|
|
exports.common = common;
|
...
|
...
|
|