Authored by 毕凯

Merge branch 'hotfix/verifymodified' into 'master'

verify-switch



See merge request !883
... ... @@ -29,14 +29,23 @@ const check = (req, res, next) => {
co(function* () {
// 如果是账号密码登录,那么需要检查是否登录失败过,登录失败过展示验证码
if (req.path === '/passport/login/auth') {
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
// 第一次登录要不要展示验证码:后台开关勾选,首次登录不需要展示
let firstLoginShowCaptcha = !_.get(req.app.locals.wap, 'close.firstLoginShowCaptcha', false);
log.info(`Check clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
log.info(`firstLoginShowCaptcha status is ${firstLoginShowCaptcha}`);
if (hasErrorLog) {
if (firstLoginShowCaptcha) {
req.yoho.captchaShow = true;
} else {
req.yoho.captchaShow = false;
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
log.info(`Check clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
if (hasErrorLog) {
req.yoho.captchaShow = true;
} else {
req.yoho.captchaShow = false;
}
}
}
... ...
... ... @@ -60,6 +60,13 @@
}
setTimeout(function() {
{{#if @root.isLogin}}
{{#if @root.isApp}}
_hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
{{^}}
_hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
{{/if}}
{{/if}}
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
... ... @@ -72,14 +79,6 @@
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})(); --}}
{{#if @root.isLogin}}
{{#if @root.isApp}}
_hmt.push(['_setCustomVar', 3, 'login', 'APP', 2]);
{{^}}
_hmt.push(['_setCustomVar', 3, 'login', 'H5', 2]);
{{/if}}
{{/if}}
}, 1000);
}());
... ...