Authored by 郭成尧

validate-log

@@ -406,7 +406,7 @@ exports.loginShowCaptchaByIp = function(req, res, next) { @@ -406,7 +406,7 @@ exports.loginShowCaptchaByIp = function(req, res, next) {
406 co(function*() { 406 co(function*() {
407 let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`); 407 let hasErrorLog = yield cache.get(`loginErrorIp:${req.yoho.clientIp}`);
408 408
409 - log.info(`clientip ${req.yoho.clientIp} status is ` + hasErrorLog); 409 + log.info(`Pagerender clientip ${req.yoho.clientIp} status is ` + hasErrorLog);
410 410
411 if (hasErrorLog) { 411 if (hasErrorLog) {
412 req.yoho.captchaShow = true; 412 req.yoho.captchaShow = true;
@@ -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 {