...
|
...
|
@@ -113,11 +113,7 @@ const local = { |
|
|
width750: true,
|
|
|
loginIndex: true, // 模板中使用JS的标识
|
|
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
|
|
|
|
|
// captchaShow: _.get(req.session, 'login.errorCount') <= 0,
|
|
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
|
|
|
|
|
// 返回的URL链接
|
|
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
|
|
showHeaderImg: true, // 控制显示头部图片
|
|
|
isPassportPage: true, // 模板中模块标识
|
...
|
...
|
@@ -167,13 +163,9 @@ const local = { |
|
|
|
|
|
res.render('international', {
|
|
|
width750: true,
|
|
|
|
|
|
// 返回的URL链接
|
|
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
|
|
loginInternational: true, // 模板中使用JS的标识
|
|
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
|
|
|
|
|
// captchaShow: _.get(req.session, 'login.errorCount') <= 0,
|
|
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
|
|
isPassportPage: true, // 模板中模块标识
|
|
|
headerText: '登录',
|
...
|
...
|
@@ -181,25 +173,21 @@ const local = { |
|
|
countrys: RegService.getAreaData(), // 地区信息列表
|
|
|
module: 'passport',
|
|
|
page: 'international',
|
|
|
title: '国际账号登录'
|
|
|
title: '国际账号登录',
|
|
|
loadJs: [
|
|
|
{
|
|
|
src: global.yoho.config.geetestJs
|
|
|
}
|
|
|
]
|
|
|
});
|
|
|
},
|
|
|
login: (req, res, next) => {
|
|
|
|
|
|
// 170306 因为暴力破解密码问题,要求每次都校验验证码
|
|
|
_.set(req.session, 'login.errorCount', 0);
|
|
|
|
|
|
let count = _.get(req.session, 'login.errorCount');
|
|
|
|
|
|
if (count == null) { // eslint-disable-line
|
|
|
_.set(req.session, 'login.errorCount', 3);
|
|
|
}
|
|
|
|
|
|
// 使用极验证
|
|
|
let useGeetest = _.get(req.app.locals.wap, 'geetest.validation', true);
|
|
|
|
|
|
// 有货自有验证码
|
|
|
if (count <= 0 && !useGeetest) {
|
|
|
// 关闭极验证的时候使用有货自有验证码
|
|
|
if (!useGeetest) {
|
|
|
let captchaInput = req.body.captcha;
|
|
|
let captchaCode = _.get(req.session, 'captcha');
|
|
|
let testCode = req.body.yohobuy;
|
...
|
...
|
@@ -212,7 +200,7 @@ const local = { |
|
|
captchaShow: true
|
|
|
};
|
|
|
|
|
|
logger.info(`验证码校验结果:${captchaInput.toString() === captchaCode},user:${captchaInput};server:${captchaCode}`);
|
|
|
logger.info(`captcha validate result:${captchaInput.toString() === captchaCode},user:${captchaInput};server:${captchaCode}`);
|
|
|
|
|
|
--req.session.captchaValidCount;
|
|
|
|
...
|
...
|
|