Authored by 毕凯

Merge branch 'hotfix/verifyalways' into 'master'

Hotfix/verifyalways



See merge request !882
@@ -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, 'close.firstLoginShowCaptcha', false);
  555 +
  556 + log.info(`firstLoginShowCaptcha status is ${firstLoginShowCaptcha}`);
  557 +
  558 + if (firstLoginShowCaptcha) {
  559 + req.yoho.captchaShow = true;
  560 + return next();
  561 + } else {
  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;
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "6.0.21", 3 + "version": "6.0.22",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -7,6 +7,8 @@ @@ -7,6 +7,8 @@
7 require('cart/order-ensure.page.css'); 7 require('cart/order-ensure.page.css');
8 require('common.js'); 8 require('common.js');
9 9
  10 +const dialog = require('plugin/dialog');
  11 +
10 let lazyLoad = require('yoho-jquery-lazyload'), 12 let lazyLoad = require('yoho-jquery-lazyload'),
11 tip = require('plugin/tip'), 13 tip = require('plugin/tip'),
12 cookie = require('yoho-cookie'); 14 cookie = require('yoho-cookie');
@@ -262,6 +264,13 @@ function submitOrder() { @@ -262,6 +264,13 @@ function submitOrder() {
262 } 264 }
263 cookie.set('order-info', '', actCkOpthn); 265 cookie.set('order-info', '', actCkOpthn);
264 window.location.href = url; 266 window.location.href = url;
  267 + } else if (res.code === 440) {
  268 + dialog.showDialog({
  269 + dialogText: res.message,
  270 + hasFooter: {
  271 + centerBtnText: '我知道了'
  272 + }
  273 + });
265 } else if (res.message) { 274 } else if (res.message) {
266 tip.show(res.message); 275 tip.show(res.message);
267 } 276 }