Authored by 毕凯

Merge branch 'hotfix/verifyalways' into 'master'

Hotfix/verifyalways



See merge request !882
... ... @@ -550,19 +550,29 @@ exports.loginShowCaptchaByIp = function(req, res, next) {
req.yoho.captchaShow = false;
}
co(function*() {
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
// 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'close.firstLoginShowCaptcha', false);
log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
log.info(`firstLoginShowCaptcha status is ${firstLoginShowCaptcha}`);
if (hasErrorLog) {
req.yoho.captchaShow = true;
}
next();
})().catch(function(e) {
if (firstLoginShowCaptcha) {
req.yoho.captchaShow = true;
next();
});
return next();
} else {
co(function* () {
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
if (hasErrorLog) {
req.yoho.captchaShow = true;
}
next();
})().catch(function(e) {
req.yoho.captchaShow = true;
next();
});
}
};
exports.common = common;
... ...
{
"name": "m-yohobuy-node",
"version": "6.0.21",
"version": "6.0.22",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -7,6 +7,8 @@
require('cart/order-ensure.page.css');
require('common.js');
const dialog = require('plugin/dialog');
let lazyLoad = require('yoho-jquery-lazyload'),
tip = require('plugin/tip'),
cookie = require('yoho-cookie');
... ... @@ -262,6 +264,13 @@ function submitOrder() {
}
cookie.set('order-info', '', actCkOpthn);
window.location.href = url;
} else if (res.code === 440) {
dialog.showDialog({
dialogText: res.message,
hasFooter: {
centerBtnText: '我知道了'
}
});
} else if (res.message) {
tip.show(res.message);
}
... ...