Authored by 周少峰

Merge branch 'master' into feature/qps

... ... @@ -150,5 +150,5 @@ library
### foreman ###
Procfile
.env
.package-lock
package-lock.json
yarn.lock
package-json.lock
... ...
... ... @@ -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
... ...
... ... @@ -49,7 +49,15 @@ const generate = (req, res, next) => {
res.type('png');
if (result.code === 200) {
request(result.data.url).pipe(res);
request({
url: result.data.url,
headers: {
'X-request-ID': req.reqID || '',
'X-YOHO-IP': req.yoho.clientIp || '',
'X-Forwarded-For': req.yoho.clientIp || '',
'User-Agent': 'yoho/nodejs'
}
}).pipe(res);
}
}).catch(next);
... ...
... ... @@ -172,7 +172,7 @@ module.exports = {
},
REQUEST_LIMIT: {
// 10s 最多访问5次
10: 8,
10: 10,
// 30s 最多访问15次
30: 20,
... ...
{
"name": "yohobuy-node",
"version": "5.9.92",
"version": "6.1.8",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -57,7 +57,7 @@
"urlencode": "^1.1.0",
"uuid": "^2.0.2",
"yoho-express-session": "^2.0.0",
"yoho-node-lib": "^0.5.12",
"yoho-node-lib": "=0.5.12",
"yoho-zookeeper": "^1.0.8"
},
"devDependencies": {
... ...
... ... @@ -19,6 +19,7 @@ var setPager = require('./detail/pager');
var notify = require('./detail/notify');
var favorite = require('./detail/brand-fav');
var intro = require('./detail/intro');
var changeNav = require('./detail/change-nav');
var bindEvent = $.Callbacks(); // eslint-disable-line
var cartEvent = new EventProxy();
... ... @@ -2012,6 +2013,9 @@ $(function() {
shownum: 5,
isCircle: true
});
// 修改导航
changeNav();
});
yasAtBottom.yasBottom();
... ...
var $ = require('yoho-jquery');
module.exports = function() {
var _channel = { // eslint-disable-line
boys: {
url: '//www.yohobuy.com',
name: 'BOYS首页'
},
girls: {
url: '//new.yohobuy.com/woman',
name: 'GIRLS首页'
},
kids: {
url: '//new.yohobuy.com/kids',
name: 'KIDS首页'
},
lifestyle: {
url: '//new.yohobuy.com/lifestyle',
name: 'LIFESTYLE首页'
}
};
var current = _channel[window.cookie('_Channel')] || _channel.boys; // eslint-disable-line
$('.path-nav > a').first()
.attr('href', current.url)
.text(current.name);
};
... ...