|
@@ -9,6 +9,7 @@ const _ = require('lodash'); |
|
@@ -9,6 +9,7 @@ const _ = require('lodash'); |
9
|
const config = global.yoho.config;
|
9
|
const config = global.yoho.config;
|
10
|
const co = Promise.coroutine;
|
10
|
const co = Promise.coroutine;
|
11
|
const cache = global.yoho.cache;
|
11
|
const cache = global.yoho.cache;
|
|
|
12
|
+const log = global.yoho.logger;
|
12
|
const geetest = require('./geetest');
|
13
|
const geetest = require('./geetest');
|
13
|
const captcha = require('./captcha');
|
14
|
const captcha = require('./captcha');
|
14
|
|
15
|
|
|
@@ -33,6 +34,8 @@ const check = (req, res, next) => { |
|
@@ -33,6 +34,8 @@ const check = (req, res, next) => { |
33
|
if (req.path === '/passport/login/auth') {
|
34
|
if (req.path === '/passport/login/auth') {
|
34
|
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
|
35
|
let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
|
35
|
|
36
|
|
|
|
37
|
+ log.info(`Check clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
|
|
|
38
|
+
|
36
|
if (hasErrorLog) {
|
39
|
if (hasErrorLog) {
|
37
|
req.yoho.captchaShow = true;
|
40
|
req.yoho.captchaShow = true;
|
38
|
} else {
|
41
|
} else {
|