...
|
...
|
@@ -9,6 +9,7 @@ const _ = require('lodash'); |
|
|
const config = global.yoho.config;
|
|
|
const co = Promise.coroutine;
|
|
|
const cache = global.yoho.cache;
|
|
|
const log = global.yoho.logger;
|
|
|
const geetest = require('./geetest');
|
|
|
const captcha = require('./captcha');
|
|
|
|
...
|
...
|
@@ -33,6 +34,8 @@ const check = (req, res, next) => { |
|
|
if (req.path === '/passport/login/auth') {
|
|
|
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 {
|
...
|
...
|
|