Authored by yyq

Merge remote-tracking branch 'origin/hotfix/whitePath' into release/1026

... ... @@ -5,9 +5,9 @@
*/
'use strict';
if (process.env.USE_APM === '1' && process.env.NODE_ENV === 'production') {
require('oneapm');
}
// if (process.env.USE_APM === '1' && process.env.NODE_ENV === 'production') {
// require('oneapm');
// }
const config = require('./config/common');
... ... @@ -30,6 +30,7 @@ const fp = require('lodash/fp');
const pkg = require('./package.json');
const app = express();
const helpers = global.yoho.helpers;
require('dnscache')({enable: true, ttl: 300, cachesize: 1000});
app.disable('x-powered-by');
... ...
... ... @@ -2,7 +2,7 @@
const robotCheckService = require('../models/robot-check-service');
const captchaService = require('../../passport/controllers/captcha');
const logger = global.yoho.logger;
const index = (req, res, next) => {
let channel = req.yoho.channel || 'boys';
... ... @@ -27,6 +27,7 @@ const isHuman = (req, res) => {
remoteIp = arr[0];
}
logger.info('isHuman', remoteIp);
robotCheckService.removeBlack(remoteIp).then(() => {
return res.json({
code: 200
... ...
... ... @@ -172,7 +172,7 @@ module.exports = {
},
REQUEST_LIMIT: {
// 10s 最多访问5次
10: 8,
10: 10,
// 30s 最多访问15次
30: 20,
... ...
... ... @@ -26,7 +26,10 @@ const PATH_WHITE_LIST = [
'/passport/images.png',
'/passport/cert/headerTip',
'/common/getbanner',
'/common/suggestfeedback'
'/common/suggestfeedback',
'/product/search/history',
'/product/search/suggest'
];
const limiter = (rule, policy, context) => {
... ...
... ... @@ -32,6 +32,7 @@
"connect-multiparty": "^2.0.0",
"cookie-parser": "^1.4.3",
"csurf": "^1.9.0",
"dnscache": "^1.0.1",
"express": "^4.13.1",
"handlebars": "4.0.5",
"lodash": "^4.13.1",
... ...