|
@@ -113,11 +113,7 @@ const local = { |
|
@@ -113,11 +113,7 @@ const local = { |
113
|
width750: true,
|
113
|
width750: true,
|
114
|
loginIndex: true, // 模板中使用JS的标识
|
114
|
loginIndex: true, // 模板中使用JS的标识
|
115
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
115
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
116
|
-
|
|
|
117
|
- // captchaShow: _.get(req.session, 'login.errorCount') <= 0,
|
|
|
118
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
116
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
119
|
-
|
|
|
120
|
- // 返回的URL链接
|
|
|
121
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
117
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
122
|
showHeaderImg: true, // 控制显示头部图片
|
118
|
showHeaderImg: true, // 控制显示头部图片
|
123
|
isPassportPage: true, // 模板中模块标识
|
119
|
isPassportPage: true, // 模板中模块标识
|
|
@@ -167,13 +163,9 @@ const local = { |
|
@@ -167,13 +163,9 @@ const local = { |
167
|
|
163
|
|
168
|
res.render('international', {
|
164
|
res.render('international', {
|
169
|
width750: true,
|
165
|
width750: true,
|
170
|
-
|
|
|
171
|
- // 返回的URL链接
|
|
|
172
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
166
|
backUrl: 'javascript:history.go(-1)', // eslint-disable-line
|
173
|
loginInternational: true, // 模板中使用JS的标识
|
167
|
loginInternational: true, // 模板中使用JS的标识
|
174
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
168
|
useGeetest: _.get(req.app.locals.wap, 'geetest.validation', true), // 使用极验证
|
175
|
-
|
|
|
176
|
- // captchaShow: _.get(req.session, 'login.errorCount') <= 0,
|
|
|
177
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
169
|
captchaShow: true, // 170306 因为暴力破解密码问题,要求每次都展示验证码
|
178
|
isPassportPage: true, // 模板中模块标识
|
170
|
isPassportPage: true, // 模板中模块标识
|
179
|
headerText: '登录',
|
171
|
headerText: '登录',
|
|
@@ -181,25 +173,21 @@ const local = { |
|
@@ -181,25 +173,21 @@ const local = { |
181
|
countrys: RegService.getAreaData(), // 地区信息列表
|
173
|
countrys: RegService.getAreaData(), // 地区信息列表
|
182
|
module: 'passport',
|
174
|
module: 'passport',
|
183
|
page: 'international',
|
175
|
page: 'international',
|
184
|
- title: '国际账号登录'
|
176
|
+ title: '国际账号登录',
|
|
|
177
|
+ loadJs: [
|
|
|
178
|
+ {
|
|
|
179
|
+ src: global.yoho.config.geetestJs
|
|
|
180
|
+ }
|
|
|
181
|
+ ]
|
185
|
});
|
182
|
});
|
186
|
},
|
183
|
},
|
187
|
login: (req, res, next) => {
|
184
|
login: (req, res, next) => {
|
188
|
|
185
|
|
189
|
- // 170306 因为暴力破解密码问题,要求每次都校验验证码
|
|
|
190
|
- _.set(req.session, 'login.errorCount', 0);
|
|
|
191
|
-
|
|
|
192
|
- let count = _.get(req.session, 'login.errorCount');
|
|
|
193
|
-
|
|
|
194
|
- if (count == null) { // eslint-disable-line
|
|
|
195
|
- _.set(req.session, 'login.errorCount', 3);
|
|
|
196
|
- }
|
|
|
197
|
-
|
|
|
198
|
// 使用极验证
|
186
|
// 使用极验证
|
199
|
let useGeetest = _.get(req.app.locals.wap, 'geetest.validation', true);
|
187
|
let useGeetest = _.get(req.app.locals.wap, 'geetest.validation', true);
|
200
|
|
188
|
|
201
|
- // 有货自有验证码
|
|
|
202
|
- if (count <= 0 && !useGeetest) {
|
189
|
+ // 关闭极验证的时候使用有货自有验证码
|
|
|
190
|
+ if (!useGeetest) {
|
203
|
let captchaInput = req.body.captcha;
|
191
|
let captchaInput = req.body.captcha;
|
204
|
let captchaCode = _.get(req.session, 'captcha');
|
192
|
let captchaCode = _.get(req.session, 'captcha');
|
205
|
let testCode = req.body.yohobuy;
|
193
|
let testCode = req.body.yohobuy;
|
|
@@ -212,7 +200,7 @@ const local = { |
|
@@ -212,7 +200,7 @@ const local = { |
212
|
captchaShow: true
|
200
|
captchaShow: true
|
213
|
};
|
201
|
};
|
214
|
|
202
|
|
215
|
- logger.info(`验证码校验结果:${captchaInput.toString() === captchaCode},user:${captchaInput};server:${captchaCode}`);
|
203
|
+ logger.info(`captcha validate result:${captchaInput.toString() === captchaCode},user:${captchaInput};server:${captchaCode}`);
|
216
|
|
204
|
|
217
|
--req.session.captchaValidCount;
|
205
|
--req.session.captchaValidCount;
|
218
|
|
206
|
|