Authored by 郭成尧

firstLoginShowCaptcha-switch

@@ -550,7 +550,16 @@ exports.loginShowCaptchaByIp = function(req, res, next) { @@ -550,7 +550,16 @@ exports.loginShowCaptchaByIp = function(req, res, next) {
550 req.yoho.captchaShow = false; 550 req.yoho.captchaShow = false;
551 } 551 }
552 552
553 - co(function*() { 553 + // 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
  554 + let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'open.firstLoginShowCaptcha', false);
  555 +
  556 + if (firstLoginShowCaptcha) {
  557 + // 因撞库,每次都展示
  558 + req.yoho.captchaShow = true;
  559 + return next();
  560 + } else {
  561 + // 勿删,可能要改回来
  562 + co(function* () {
554 let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`); 563 let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
555 564
556 log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog); 565 log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
@@ -563,6 +572,7 @@ exports.loginShowCaptchaByIp = function(req, res, next) { @@ -563,6 +572,7 @@ exports.loginShowCaptchaByIp = function(req, res, next) {
563 req.yoho.captchaShow = true; 572 req.yoho.captchaShow = true;
564 next(); 573 next();
565 }); 574 });
  575 + }
566 }; 576 };
567 577
568 exports.common = common; 578 exports.common = common;