Merge branch 'hotfix/verifyalways' into 'master'
Hotfix/verifyalways See merge request !882
Showing
3 changed files
with
30 additions
and
11 deletions
@@ -550,19 +550,29 @@ exports.loginShowCaptchaByIp = function(req, res, next) { | @@ -550,19 +550,29 @@ exports.loginShowCaptchaByIp = function(req, res, next) { | ||
550 | req.yoho.captchaShow = false; | 550 | req.yoho.captchaShow = false; |
551 | } | 551 | } |
552 | 552 | ||
553 | - co(function*() { | ||
554 | - let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`); | 553 | + // 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示 |
554 | + let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'close.firstLoginShowCaptcha', false); | ||
555 | 555 | ||
556 | - log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog); | 556 | + log.info(`firstLoginShowCaptcha status is ${firstLoginShowCaptcha}`); |
557 | 557 | ||
558 | - if (hasErrorLog) { | ||
559 | - req.yoho.captchaShow = true; | ||
560 | - } | ||
561 | - next(); | ||
562 | - })().catch(function(e) { | 558 | + if (firstLoginShowCaptcha) { |
563 | req.yoho.captchaShow = true; | 559 | req.yoho.captchaShow = true; |
564 | - next(); | ||
565 | - }); | 560 | + return next(); |
561 | + } else { | ||
562 | + co(function* () { | ||
563 | + let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`); | ||
564 | + | ||
565 | + log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog); | ||
566 | + | ||
567 | + if (hasErrorLog) { | ||
568 | + req.yoho.captchaShow = true; | ||
569 | + } | ||
570 | + next(); | ||
571 | + })().catch(function(e) { | ||
572 | + req.yoho.captchaShow = true; | ||
573 | + next(); | ||
574 | + }); | ||
575 | + } | ||
566 | }; | 576 | }; |
567 | 577 | ||
568 | exports.common = common; | 578 | exports.common = common; |
@@ -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 | } |
-
Please register or login to post a comment