Merge branch 'gray'
Showing
23 changed files
with
265 additions
and
200 deletions
@@ -59,7 +59,7 @@ exports.submit = (req, res) => { | @@ -59,7 +59,7 @@ exports.submit = (req, res) => { | ||
59 | if (geetestRes) { | 59 | if (geetestRes) { |
60 | logger.info('geetest success'); | 60 | logger.info('geetest success'); |
61 | 61 | ||
62 | - let remoteIp = req.get('X-Forwarded-For') || req.ip; | 62 | + let remoteIp = req.yoho.clientIp; |
63 | 63 | ||
64 | if (remoteIp.indexOf(',') > 0) { | 64 | if (remoteIp.indexOf(',') > 0) { |
65 | let arr = remoteIp.split(','); | 65 | let arr = remoteIp.split(','); |
@@ -67,7 +67,25 @@ exports.submit = (req, res) => { | @@ -67,7 +67,25 @@ exports.submit = (req, res) => { | ||
67 | remoteIp = arr[0]; | 67 | remoteIp = arr[0]; |
68 | } | 68 | } |
69 | 69 | ||
70 | - let operations = [cache.delAsync(`${config.app}:limiter:${remoteIp}`)]; | 70 | + // pc:limiter:IP 和PC端共用 |
71 | + let operations = [cache.delAsync(`pc:limiter:${remoteIp}`)]; | ||
72 | + | ||
73 | + // 验证码之后一小时之内不再限制qps | ||
74 | + if (req.session.apiLimitValidate) { | ||
75 | + operations.push(cache.setAsync( | ||
76 | + `${config.app}:limiter:api:ishuman:${remoteIp}`, | ||
77 | + 1, | ||
78 | + config.LIMITER_IP_TIME | ||
79 | + )); | ||
80 | + } else { | ||
81 | + operations.push(cache.setAsync( | ||
82 | + `${config.app}:limiter:ishuman:${remoteIp}`, | ||
83 | + 1, | ||
84 | + config.LIMITER_IP_TIME | ||
85 | + )); | ||
86 | + } | ||
87 | + | ||
88 | + delete req.session.apiLimitValidate; | ||
71 | 89 | ||
72 | if (req.body.pid) { | 90 | if (req.body.pid) { |
73 | let riskPid = decodeURIComponent(req.body.pid) + ':' + _.get(req.yoho, 'clientIp', ''); | 91 | let riskPid = decodeURIComponent(req.body.pid) + ':' + _.get(req.yoho, 'clientIp', ''); |
@@ -115,39 +115,39 @@ router.get('/onlineservice', onlineService.getOnlineServiceInfo); | @@ -115,39 +115,39 @@ router.get('/onlineservice', onlineService.getOnlineServiceInfo); | ||
115 | router.get('/onlineservicedetail', onlineService.getOnlineServiceDetail); | 115 | router.get('/onlineservicedetail', onlineService.getOnlineServiceDetail); |
116 | 116 | ||
117 | // 分期付款 | 117 | // 分期付款 |
118 | -router.get('/installment/index', installment.sessionKeyAuth, installment.index); // 开通分期首页 | ||
119 | -router.get('/installment/review', installment.sessionKeyAuth, installment.review); // 开通分期首页 | ||
120 | -router.get('/installment/starting-service', installment.sessionKeyAuth, installment.startingService); // 分期付款开通 | ||
121 | -router.get('/installment/starting-service/verify-code', installment.sessionKeyAuth, installment.verifyCode); | ||
122 | -router.get('/installment/starting-service/check-verify-code', installment.sessionKeyAuth, installment.checkVerifyCode); | ||
123 | -router.get('/installment/get-goods', installment.sessionKeyAuth, installment.getInstallmentGoods); // ajax请求分期专享商品数据 | ||
124 | - | ||
125 | -router.get('/installment/repay/overdue', installment.sessionKeyAuth, installment.overdueList); // 逾期未还款列表 | ||
126 | -router.get('/installment/repay/7daylist', installment.sessionKeyAuth, installment.sevenDayList); // 7日待还款列表 | ||
127 | -router.get('/installment/repay/month', installment.sessionKeyAuth, installment.monthRepayList); // 本月待还款列表 | ||
128 | -router.get('/installment/repay/total', installment.sessionKeyAuth, installment.totalRepayList); // 待还总金额列表 | ||
129 | -router.get('/installment/repay/record', installment.sessionKeyAuth, installment.repayRecordPage); // 还款记录 | ||
130 | -router.get('/installment/repay/get-record', installment.sessionKeyAuth, installment.getRepayRecord); // ajax请求还款记录 | ||
131 | -router.get('/installment/repay/detail', installment.sessionKeyAuth, installment.repayDetail); // 还款详情 | ||
132 | - | ||
133 | -router.get('/installment/account', installment.sessionKeyAuth, installment.account); // 账户管理 | ||
134 | -router.get('/installment/bind-card', installment.sessionKeyAuth, installment.bindCard); // 添加新银行卡 | ||
135 | -router.get('/installment/post-account', installment.sessionKeyAuth, installment.postAccount); // 添加新卡请求 | ||
136 | -router.get('/installment/bank-info', installment.sessionKeyAuth, installment.getBankInfo); | ||
137 | -router.post('/installment/activate-service', installment.sessionKeyAuth, installment.activateService); | ||
138 | -router.get('/installment/order', installment.sessionKeyAuth, installment.orderIndex); | ||
139 | -router.get('/installment/order.html', installment.sessionKeyAuth, installment.orderList); | ||
140 | -router.get('/installment/order/:id', installment.sessionKeyAuth, installment.orderDetail); | ||
141 | -router.get('/installment/total-amount.json', installment.sessionKeyAuth, installment.totalAmount); | 118 | +router.get('/installment/index', auth, installment.index); // 开通分期首页 |
119 | +router.get('/installment/review', auth, installment.review); // 开通分期首页 | ||
120 | +router.get('/installment/starting-service', auth, installment.startingService); // 分期付款开通 | ||
121 | +router.get('/installment/starting-service/verify-code', auth, installment.verifyCode); | ||
122 | +router.get('/installment/starting-service/check-verify-code', auth, installment.checkVerifyCode); | ||
123 | +router.get('/installment/get-goods', auth, installment.getInstallmentGoods); // ajax请求分期专享商品数据 | ||
124 | + | ||
125 | +router.get('/installment/repay/overdue', auth, installment.overdueList); // 逾期未还款列表 | ||
126 | +router.get('/installment/repay/7daylist', auth, installment.sevenDayList); // 7日待还款列表 | ||
127 | +router.get('/installment/repay/month', auth, installment.monthRepayList); // 本月待还款列表 | ||
128 | +router.get('/installment/repay/total', auth, installment.totalRepayList); // 待还总金额列表 | ||
129 | +router.get('/installment/repay/record', auth, installment.repayRecordPage); // 还款记录 | ||
130 | +router.get('/installment/repay/get-record', auth, installment.getRepayRecord); // ajax请求还款记录 | ||
131 | +router.get('/installment/repay/detail', auth, installment.repayDetail); // 还款详情 | ||
132 | + | ||
133 | +router.get('/installment/account', auth, installment.account); // 账户管理 | ||
134 | +router.get('/installment/bind-card', auth, installment.bindCard); // 添加新银行卡 | ||
135 | +router.get('/installment/post-account', auth, installment.postAccount); // 添加新卡请求 | ||
136 | +router.get('/installment/bank-info', auth, installment.getBankInfo); | ||
137 | +router.post('/installment/activate-service', auth, installment.activateService); | ||
138 | +router.get('/installment/order', auth, installment.orderIndex); | ||
139 | +router.get('/installment/order.html', auth, installment.orderList); | ||
140 | +router.get('/installment/order/:id', auth, installment.orderDetail); | ||
141 | +router.get('/installment/total-amount.json', auth, installment.totalAmount); | ||
142 | 142 | ||
143 | router.get('/installment/help', installment.sessionKeyAuth, installment.help);// 帮助静态页面 | 143 | router.get('/installment/help', installment.sessionKeyAuth, installment.help);// 帮助静态页面 |
144 | router.get('/installment/agreement', installment.sessionKeyAuth, installment.agreement);// 服务协议静态页面 | 144 | router.get('/installment/agreement', installment.sessionKeyAuth, installment.agreement);// 服务协议静态页面 |
145 | 145 | ||
146 | router.get('/installment/server-crash', installment.sessionKeyAuth, installment.serverCrash); // 服务器崩溃 | 146 | router.get('/installment/server-crash', installment.sessionKeyAuth, installment.serverCrash); // 服务器崩溃 |
147 | -router.get('/installment/bank-card', installment.sessionKeyAuth, installment.bankCard); // 银行卡列表 | ||
148 | -router.get('/installment/card-detail', installment.sessionKeyAuth, installment.cardDetail); // 银行卡详情 | ||
149 | -router.get('/installment/delBankCard', installment.sessionKeyAuth, installment.delBankCard); // 删除绑定 | ||
150 | -router.get('/installment/setMasterCard', installment.sessionKeyAuth, installment.setMasterCard); // 切换主卡 | 147 | +router.get('/installment/bank-card', auth, installment.bankCard); // 银行卡列表 |
148 | +router.get('/installment/card-detail', auth, installment.cardDetail); // 银行卡详情 | ||
149 | +router.get('/installment/delBankCard', auth, installment.delBankCard); // 删除绑定 | ||
150 | +router.get('/installment/setMasterCard', auth, installment.setMasterCard); // 切换主卡 | ||
151 | 151 | ||
152 | router.get('/getaddress.json', addressController.newGetAddress); // TODO 模拟省数据 | 152 | router.get('/getaddress.json', addressController.newGetAddress); // TODO 模拟省数据 |
153 | 153 |
@@ -45,7 +45,8 @@ module.exports = class extends global.yoho.BaseModel { | @@ -45,7 +45,8 @@ module.exports = class extends global.yoho.BaseModel { | ||
45 | sales: 'Y', | 45 | sales: 'Y', |
46 | outlets: 2, | 46 | outlets: 2, |
47 | stocknumber: 1, | 47 | stocknumber: 1, |
48 | - need_filter: 'no' | 48 | + need_filter: 'no', |
49 | + from: 'fuzzySearch' | ||
49 | }; | 50 | }; |
50 | 51 | ||
51 | finalParams = _.assign(finalParams, searchProcess.getSearchParamsWithoutMethod(params)); | 52 | finalParams = _.assign(finalParams, searchProcess.getSearchParamsWithoutMethod(params)); |
@@ -255,6 +255,10 @@ module.exports = class extends global.yoho.BaseModel { | @@ -255,6 +255,10 @@ module.exports = class extends global.yoho.BaseModel { | ||
255 | method = 'app.search.li'; | 255 | method = 'app.search.li'; |
256 | } | 256 | } |
257 | 257 | ||
258 | + if (method === 'web.search.search') { | ||
259 | + params.from = 'categoryList'; | ||
260 | + } | ||
261 | + | ||
258 | let paramsForApi = searchProcess.getSearchParamsWithoutMethod(params); | 262 | let paramsForApi = searchProcess.getSearchParamsWithoutMethod(params); |
259 | 263 | ||
260 | return this.get({ | 264 | return this.get({ |
@@ -160,6 +160,7 @@ module.exports = { | @@ -160,6 +160,7 @@ module.exports = { | ||
160 | // 100s 最多访问200次 | 160 | // 100s 最多访问200次 |
161 | 600: 200 | 161 | 600: 200 |
162 | }, | 162 | }, |
163 | + LIMITER_IP_TIME: 3600, // 超出访问限制ip限制访问1小时 | ||
163 | superCapture: '93c70db61fe276f93ce781ad17dc47cd', | 164 | superCapture: '93c70db61fe276f93ce781ad17dc47cd', |
164 | from: from | 165 | from: from |
165 | }; | 166 | }; |
@@ -4,8 +4,10 @@ | @@ -4,8 +4,10 @@ | ||
4 | */ | 4 | */ |
5 | const headerModel = require('../models/header'); | 5 | const headerModel = require('../models/header'); |
6 | const logger = global.yoho.logger; | 6 | const logger = global.yoho.logger; |
7 | +const cache = global.yoho.cache.master; | ||
7 | const helpers = global.yoho.helpers; | 8 | const helpers = global.yoho.helpers; |
8 | const sender = global.yoho.apmSender; | 9 | const sender = global.yoho.apmSender; |
10 | +const config = global.yoho.config; | ||
9 | const hostname = require('os').hostname(); | 11 | const hostname = require('os').hostname(); |
10 | const routeEncode = require('./route-encode'); | 12 | const routeEncode = require('./route-encode'); |
11 | const _ = require('lodash'); | 13 | const _ = require('lodash'); |
@@ -20,6 +22,51 @@ const forceNoCache = (res) => { | @@ -20,6 +22,51 @@ const forceNoCache = (res) => { | ||
20 | } | 22 | } |
21 | }; | 23 | }; |
22 | 24 | ||
25 | +const _err510 = (req, res, code, err) => { | ||
26 | + res.status(code); | ||
27 | + | ||
28 | + if (req.xhr) { | ||
29 | + return res.json({ | ||
30 | + code: err.code, | ||
31 | + message: '服务器繁忙请稍后重试!' | ||
32 | + }); | ||
33 | + } | ||
34 | + | ||
35 | + return res.render('error/510', { | ||
36 | + err: err, | ||
37 | + module: 'common', | ||
38 | + page: 'error', | ||
39 | + title: '服务器繁忙 | Yoho!Buy有货 | 潮流购物逛不停', | ||
40 | + pageHeader: headerModel.setNav({ | ||
41 | + navTitle: '服务器繁忙请稍后重试!' | ||
42 | + }), | ||
43 | + pageFooter: true, | ||
44 | + isErr: true | ||
45 | + }); | ||
46 | +}; | ||
47 | + | ||
48 | +const _err500 = (req, res, code, err) => { | ||
49 | + res.status(code); | ||
50 | + | ||
51 | + if (req.xhr) { | ||
52 | + return res.json({ | ||
53 | + code: err.code, | ||
54 | + message: '服务器错误!' | ||
55 | + }); | ||
56 | + } | ||
57 | + | ||
58 | + return res.render('error/500', { | ||
59 | + err: err, | ||
60 | + module: 'common', | ||
61 | + page: 'error', | ||
62 | + title: '服务器错误 | Yoho!Buy有货 | 潮流购物逛不停', | ||
63 | + pageHeader: headerModel.setNav({ | ||
64 | + navTitle: '服务器错误!' | ||
65 | + }), | ||
66 | + pageFooter: true, | ||
67 | + isErr: true | ||
68 | + }); | ||
69 | +}; | ||
23 | 70 | ||
24 | exports.notFound = () => { | 71 | exports.notFound = () => { |
25 | return (req, res) => { | 72 | return (req, res) => { |
@@ -51,11 +98,12 @@ exports.notFound = () => { | @@ -51,11 +98,12 @@ exports.notFound = () => { | ||
51 | * @return {[type]} | 98 | * @return {[type]} |
52 | */ | 99 | */ |
53 | exports.serverError = () => { | 100 | exports.serverError = () => { |
54 | - return (err, req, res, next) => { | ||
55 | - forceNoCache(res); | 101 | + return async(err, req, res, next) => { |
56 | const uid = req.user ? req.user.uid : 0; | 102 | const uid = req.user ? req.user.uid : 0; |
57 | const udid = _.get(req, 'cookies.udid', 'yoho'); | 103 | const udid = _.get(req, 'cookies.udid', 'yoho'); |
58 | 104 | ||
105 | + forceNoCache(res); | ||
106 | + | ||
59 | err.code = err.code || err.statusCode || 500; | 107 | err.code = err.code || err.statusCode || 500; |
60 | 108 | ||
61 | if (req.isApmReport && err.code !== 401) { | 109 | if (req.isApmReport && err.code !== 401) { |
@@ -63,7 +111,7 @@ exports.serverError = () => { | @@ -63,7 +111,7 @@ exports.serverError = () => { | ||
63 | sender.addMessage({ | 111 | sender.addMessage({ |
64 | measurement: 'error-report', | 112 | measurement: 'error-report', |
65 | tags: { | 113 | tags: { |
66 | - app: global.yoho.config.appName, // 应用名称 | 114 | + app: config.appName, // 应用名称 |
67 | hostname, | 115 | hostname, |
68 | type: 'server', | 116 | type: 'server', |
69 | route: `[${req.method}]${_.get(req, 'route.path', '')}`, // 请求路由 | 117 | route: `[${req.method}]${_.get(req, 'route.path', '')}`, // 请求路由 |
@@ -106,33 +154,45 @@ exports.serverError = () => { | @@ -106,33 +154,45 @@ exports.serverError = () => { | ||
106 | refer: req.originalUrl | 154 | refer: req.originalUrl |
107 | })); | 155 | })); |
108 | } | 156 | } |
109 | - } | 157 | + } else if (err.code === 9999991 || err.code === 9999992) { |
158 | + let remoteIp = req.yoho.clientIp; | ||
110 | 159 | ||
111 | - logger.error(`error at path: ${req.url}`); | ||
112 | - logger.error(err); | 160 | + const isHuman = await cache.getAsync(`${config.app}:limiter:api:ishuman:${remoteIp}`); |
113 | 161 | ||
114 | - if (!res.headersSent) { | ||
115 | - res.status(err.code); | 162 | + if (!isHuman) { |
163 | + if (remoteIp.indexOf(',') > 0) { | ||
164 | + let arr = remoteIp.split(','); | ||
116 | 165 | ||
117 | - if (req.xhr) { | ||
118 | - return res.json({ | ||
119 | - code: err.code, | ||
120 | - message: '服务器错误!' | 166 | + remoteIp = arr[0]; |
167 | + } | ||
168 | + cache.setAsync(`${config.app}:limiter:${remoteIp}`, 1, config.LIMITER_IP_TIME); | ||
169 | + | ||
170 | + let limitAPI = helpers.urlFormat('/3party/check', {refer: req.get('Referer') || ''}); | ||
171 | + let limitPage = helpers.urlFormat('/3party/check', { | ||
172 | + refer: req.protocol + '://' + req.get('host') + req.originalUrl | ||
121 | }); | 173 | }); |
174 | + | ||
175 | + req.session.apiLimitValidate = true; | ||
176 | + if (req.xhr) { | ||
177 | + return res.status(510).json({ | ||
178 | + code: err.code, | ||
179 | + data: {refer: limitAPI} | ||
180 | + }); | ||
181 | + } | ||
182 | + | ||
183 | + return res.redirect(limitPage); | ||
122 | } | 184 | } |
123 | 185 | ||
124 | - return res.render('error/500', { | ||
125 | - err: err, | ||
126 | - module: 'common', | ||
127 | - page: 'error', | ||
128 | - title: '服务器错误 | Yoho!Buy有货 | 潮流购物逛不停', | ||
129 | - pageHeader: headerModel.setNav({ | ||
130 | - navTitle: '服务器错误!' | ||
131 | - }), | ||
132 | - pageFooter: true, | ||
133 | - isErr: true | ||
134 | - }); | 186 | + return _err510(req, res, 510, err); |
187 | + } | ||
188 | + | ||
189 | + logger.error(`error at path: ${req.url}`); | ||
190 | + logger.error(err); | ||
191 | + | ||
192 | + if (!res.headersSent) { | ||
193 | + return _err500(req, res, err.code, err); | ||
135 | } | 194 | } |
136 | - next(err); | 195 | + |
196 | + return next(err); | ||
137 | }; | 197 | }; |
138 | }; | 198 | }; |
@@ -70,7 +70,7 @@ module.exports = (req, res, next) => { | @@ -70,7 +70,7 @@ module.exports = (req, res, next) => { | ||
70 | // 排除条件:ip白名单/路径白名单/异步请求/登录用户 | 70 | // 排除条件:ip白名单/路径白名单/异步请求/登录用户 |
71 | const excluded = _.includes(IP_WHITE_LIST, remoteIp) || | 71 | const excluded = _.includes(IP_WHITE_LIST, remoteIp) || |
72 | _.includes(PATH_WHITE_LIST, req.path) || req.xhr || !_.isEmpty(_.get(req, 'user.uid')); | 72 | _.includes(PATH_WHITE_LIST, req.path) || req.xhr || !_.isEmpty(_.get(req, 'user.uid')); |
73 | - const enabled = !_.get(req.app.locals, 'wap.sys.noLimite'); | 73 | + const enabled = !_.get(req.app.locals, 'wap.sys.noLimiter'); |
74 | 74 | ||
75 | logger.debug(`request remote ip: ${remoteIp}; excluded: ${excluded}; enabled: ${enabled}`); | 75 | logger.debug(`request remote ip: ${remoteIp}; excluded: ${excluded}; enabled: ${enabled}`); |
76 | 76 |
@@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
2 | 2 | ||
3 | const helpers = global.yoho.helpers; | 3 | const helpers = global.yoho.helpers; |
4 | const _ = require('lodash'); | 4 | const _ = require('lodash'); |
5 | + | ||
5 | const WHITE_LIST = [ | 6 | const WHITE_LIST = [ |
6 | '/3party/check', | 7 | '/3party/check', |
7 | '/3party/check/submit', | 8 | '/3party/check/submit', |
@@ -27,8 +28,7 @@ module.exports = (req, res, next) => { | @@ -27,8 +28,7 @@ module.exports = (req, res, next) => { | ||
27 | } | 28 | } |
28 | 29 | ||
29 | if (req.xhr) { | 30 | if (req.xhr) { |
30 | - return res.json({ | ||
31 | - code: 400, | 31 | + return res.status(510).json({ |
32 | data: {refer: limitAPI} | 32 | data: {refer: limitAPI} |
33 | }); | 33 | }); |
34 | } | 34 | } |
@@ -26,9 +26,9 @@ function isNormalSpider(userAgent) { | @@ -26,9 +26,9 @@ function isNormalSpider(userAgent) { | ||
26 | 26 | ||
27 | module.exports = (limiter, policy) => { | 27 | module.exports = (limiter, policy) => { |
28 | const ua = limiter.req.header('User-Agent'); | 28 | const ua = limiter.req.header('User-Agent'); |
29 | - const synchronizeKey = `wap:limiter:synchronize:${limiter.remoteIp}`; // 同步 | ||
30 | - const asynchronousKey = `wap:limiter:asynchronous:${limiter.remoteIp}`; // 异步 | ||
31 | - const spiderKey = `wap:limiter:spider:${limiter.remoteIp}`; // 异步 | 29 | + const synchronizeKey = `pc:limiter:synchronize:${limiter.remoteIp}`; // 同步 |
30 | + const asynchronousKey = `pc:limiter:asynchronous:${limiter.remoteIp}`; // 异步 | ||
31 | + const spiderKey = `pc:limiter:spider:${limiter.remoteIp}`; // 异步 | ||
32 | 32 | ||
33 | // 正常蜘蛛直接过 | 33 | // 正常蜘蛛直接过 |
34 | if (isNormalSpider(ua)) { | 34 | if (isNormalSpider(ua)) { |
@@ -9,7 +9,7 @@ module.exports = (limiter, policy) => { | @@ -9,7 +9,7 @@ module.exports = (limiter, policy) => { | ||
9 | res = limiter.res, | 9 | res = limiter.res, |
10 | next = limiter.next; // eslint-disable-line | 10 | next = limiter.next; // eslint-disable-line |
11 | 11 | ||
12 | - const key = `wap:limiter:faker:${limiter.remoteIp}`; | 12 | + const key = `pc:limiter:faker:${limiter.remoteIp}`; |
13 | 13 | ||
14 | if (req.header('X-Requested-With') === 'XMLHttpRequest') { | 14 | if (req.header('X-Requested-With') === 'XMLHttpRequest') { |
15 | cache.decrAsync(key, 1); | 15 | cache.decrAsync(key, 1); |
@@ -10,9 +10,6 @@ const cache = global.yoho.cache.master; | @@ -10,9 +10,6 @@ const cache = global.yoho.cache.master; | ||
10 | const config = global.yoho.config; | 10 | const config = global.yoho.config; |
11 | const _ = require('lodash'); | 11 | const _ = require('lodash'); |
12 | 12 | ||
13 | -// 超出访问限制ip限制访问1小时 | ||
14 | -const limiterIpTime = 3600; | ||
15 | - | ||
16 | // 页面访问限制 | 13 | // 页面访问限制 |
17 | const MAX_TIMES = config.REQUEST_LIMIT; | 14 | const MAX_TIMES = config.REQUEST_LIMIT; |
18 | 15 | ||
@@ -27,12 +24,18 @@ module.exports = (limiter, policy) => { | @@ -27,12 +24,18 @@ module.exports = (limiter, policy) => { | ||
27 | getOp[key] = cache.getAsync(ruleKeys[key]); | 24 | getOp[key] = cache.getAsync(ruleKeys[key]); |
28 | }); | 25 | }); |
29 | 26 | ||
27 | + getOp.human = cache.getAsync(`${config.app}:limiter:ishuman:${limiter.remoteIp}`); | ||
28 | + | ||
30 | return Promise.props(getOp).then((results) => { | 29 | return Promise.props(getOp).then((results) => { |
31 | 30 | ||
32 | logger.debug(MAX_TIMES); | 31 | logger.debug(MAX_TIMES); |
33 | logger.debug(_.values(ruleKeys)); | 32 | logger.debug(_.values(ruleKeys)); |
34 | logger.debug(results); | 33 | logger.debug(results); |
35 | 34 | ||
35 | + if (results.human) { // 经过验证码之后1小时有效期内不再验证qps | ||
36 | + return Promise.resolve(true); | ||
37 | + } | ||
38 | + | ||
36 | // 遍历限制规则,若满足返回相应处理策略, 否则页面访问次数加1 | 39 | // 遍历限制规则,若满足返回相应处理策略, 否则页面访问次数加1 |
37 | let operation = []; | 40 | let operation = []; |
38 | 41 | ||
@@ -42,9 +45,10 @@ module.exports = (limiter, policy) => { | @@ -42,9 +45,10 @@ module.exports = (limiter, policy) => { | ||
42 | if (!results[key]) { | 45 | if (!results[key]) { |
43 | operation.push(cache.setAsync(cacheKey, 1, +key)); | 46 | operation.push(cache.setAsync(cacheKey, 1, +key)); |
44 | } else if (+results[key] > +val) { | 47 | } else if (+results[key] > +val) { |
48 | + logger.warn(`pc:limiter:${limiter.remoteIp}`); | ||
45 | 49 | ||
46 | // ip限制1小时 | 50 | // ip限制1小时 |
47 | - operation.push(cache.setAsync(`pc:limiter:${limiter.remoteIp}`, 1, limiterIpTime)); | 51 | + operation.push(cache.setAsync(`pc:limiter:${limiter.remoteIp}`, 1, config.LIMITER_IP_TIME)); |
48 | return Promise.resolve(policy); | 52 | return Promise.resolve(policy); |
49 | } else { | 53 | } else { |
50 | operation.push(cache.incrAsync(cacheKey, 1)); | 54 | operation.push(cache.incrAsync(cacheKey, 1)); |
doraemon/views/error/510.hbs
0 → 100644
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | a.async = 1; | 12 | a.async = 1; |
13 | a.src = j; | 13 | a.src = j; |
14 | m.parentNode.insertBefore(a, m); | 14 | m.parentNode.insertBefore(a, m); |
15 | - }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.15/yas.js', '_yas')); | 15 | + }(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//cdn.yoho.cn/yas-jssdk/2.4.16/yas.js', '_yas')); |
16 | 16 | ||
17 | var _hmt = _hmt || []; | 17 | var _hmt = _hmt || []; |
18 | 18 | ||
@@ -56,7 +56,7 @@ | @@ -56,7 +56,7 @@ | ||
56 | uid = uid === 0 ? '' : uid; | 56 | uid = uid === 0 ? '' : uid; |
57 | window._ozuid = uid; // 暴露ozuid | 57 | window._ozuid = uid; // 暴露ozuid |
58 | if (window._yas) { | 58 | if (window._yas) { |
59 | - window._yas(1 * new Date(), '2.4.15', 'yohobuy_m', uid, '', ''); | 59 | + window._yas(1 * new Date(), '2.4.16', 'yohobuy_m', uid, '', ''); |
60 | } | 60 | } |
61 | 61 | ||
62 | setTimeout(function() { | 62 | setTimeout(function() { |
1 | { | 1 | { |
2 | "name": "yohobuywap-node", | 2 | "name": "yohobuywap-node", |
3 | - "version": "6.5.32", | 3 | + "version": "6.5.34", |
4 | "private": true, | 4 | "private": true, |
5 | "description": "A New Yohobuy Project With Express", | 5 | "description": "A New Yohobuy Project With Express", |
6 | "repository": { | 6 | "repository": { |
@@ -74,13 +74,14 @@ | @@ -74,13 +74,14 @@ | ||
74 | "xml2js": "^0.4.19", | 74 | "xml2js": "^0.4.19", |
75 | "yoho-express-session": "^2.0.0", | 75 | "yoho-express-session": "^2.0.0", |
76 | "yoho-md5": "^2.0.0", | 76 | "yoho-md5": "^2.0.0", |
77 | - "yoho-node-lib": "=0.6.2", | 77 | + "yoho-node-lib": "=0.6.3", |
78 | "yoho-zookeeper": "^1.0.9" | 78 | "yoho-zookeeper": "^1.0.9" |
79 | }, | 79 | }, |
80 | "devDependencies": { | 80 | "devDependencies": { |
81 | "@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0", | 81 | "@mapbox/stylelint-processor-arbitrary-tags": "^0.2.0", |
82 | "autoprefixer": "^7.2.4", | 82 | "autoprefixer": "^7.2.4", |
83 | "babel-core": "^6.26.0", | 83 | "babel-core": "^6.26.0", |
84 | + "babel-eslint": "^8.2.2", | ||
84 | "babel-loader": "^7.1.2", | 85 | "babel-loader": "^7.1.2", |
85 | "babel-plugin-transform-runtime": "^6.23.0", | 86 | "babel-plugin-transform-runtime": "^6.23.0", |
86 | "babel-preset-env": "^1.6.0", | 87 | "babel-preset-env": "^1.6.0", |
@@ -54,6 +54,9 @@ class GradeDetailPage extends Page { | @@ -54,6 +54,9 @@ class GradeDetailPage extends Page { | ||
54 | this.noListData = false; | 54 | this.noListData = false; |
55 | this.graphData = {}; | 55 | this.graphData = {}; |
56 | 56 | ||
57 | + this.timer = null; | ||
58 | + this.cacheMouthDetailResult = []; | ||
59 | + | ||
57 | this.graphRender(); | 60 | this.graphRender(); |
58 | this.monthDetailRender(true); | 61 | this.monthDetailRender(true); |
59 | 62 | ||
@@ -81,30 +84,36 @@ class GradeDetailPage extends Page { | @@ -81,30 +84,36 @@ class GradeDetailPage extends Page { | ||
81 | * 滑动事件处理 | 84 | * 滑动事件处理 |
82 | */ | 85 | */ |
83 | dataZoomEvent() { | 86 | dataZoomEvent() { |
84 | - let optionData = this.eGradeGraph.getOption(); | ||
85 | - let endIndex = optionData.dataZoom[0].endValue; | 87 | + if (this.timer) { |
88 | + clearTimeout(this.timer); | ||
89 | + } | ||
86 | 90 | ||
87 | - let tapData = this.graphData.seriesData[endIndex]; | 91 | + this.timer = setTimeout(() => { |
92 | + let optionData = this.eGradeGraph.getOption(); | ||
93 | + let endIndex = optionData.dataZoom[0].endValue; | ||
88 | 94 | ||
89 | - this.year = tapData.year; | ||
90 | - this.month = tapData.month; | ||
91 | - this.page = 0; | 95 | + let tapData = this.graphData.seriesData[endIndex]; |
92 | 96 | ||
93 | - this.refreshEchart(endIndex); | ||
94 | - this.monthDetailRender(true); | 97 | + this.year = tapData.year; |
98 | + this.month = tapData.month; | ||
99 | + this.page = 0; | ||
95 | 100 | ||
96 | - if (window._yas && window._yas.sendCustomInfo) { | ||
97 | - // 埋点 | ||
98 | - let C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
99 | - | ||
100 | - window._yas.sendCustomInfo({ | ||
101 | - op: 'YB_GRADE_DETAIL_GRAPH_DATAZOOM', | ||
102 | - appop: 'YB_H5_GRADE_DETAIL_GRAPH_DATAZOOM', | ||
103 | - param: JSON.stringify({ | ||
104 | - C_ID: C_ID | ||
105 | - }) | ||
106 | - }, true); | ||
107 | - } | 101 | + this.refreshEchart(endIndex); |
102 | + this.monthDetailRender(true); | ||
103 | + | ||
104 | + if (window._yas && window._yas.sendCustomInfo) { | ||
105 | + // 埋点 | ||
106 | + let C_ID = window._ChannelVary[window.cookie('_Channel')]; | ||
107 | + | ||
108 | + window._yas.sendCustomInfo({ | ||
109 | + op: 'YB_GRADE_DETAIL_GRAPH_DATAZOOM', | ||
110 | + appop: 'YB_H5_GRADE_DETAIL_GRAPH_DATAZOOM', | ||
111 | + param: JSON.stringify({ | ||
112 | + C_ID: C_ID | ||
113 | + }) | ||
114 | + }, true); | ||
115 | + } | ||
116 | + }, 200); | ||
108 | } | 117 | } |
109 | 118 | ||
110 | /** | 119 | /** |
@@ -208,6 +217,19 @@ class GradeDetailPage extends Page { | @@ -208,6 +217,19 @@ class GradeDetailPage extends Page { | ||
208 | 217 | ||
209 | this.page++; | 218 | this.page++; |
210 | this.requesting = true; | 219 | this.requesting = true; |
220 | + | ||
221 | + let cacheResult = this.cacheMouthDetailResult[`${this.year}:${this.month}:${this.page}`]; | ||
222 | + | ||
223 | + if (cacheResult) { | ||
224 | + if (isInit) { | ||
225 | + this.view.gradeBillList.html(cacheResult); | ||
226 | + } else { | ||
227 | + this.view.gradeBillList.append(cacheResult); | ||
228 | + } | ||
229 | + this.requesting = false; | ||
230 | + return; | ||
231 | + } | ||
232 | + | ||
211 | this.ajax({ | 233 | this.ajax({ |
212 | url: '/activity/grade/monthDetail', | 234 | url: '/activity/grade/monthDetail', |
213 | data: { | 235 | data: { |
@@ -225,6 +247,7 @@ class GradeDetailPage extends Page { | @@ -225,6 +247,7 @@ class GradeDetailPage extends Page { | ||
225 | this.view.gradeBillList.append(monthDetailPage); | 247 | this.view.gradeBillList.append(monthDetailPage); |
226 | } | 248 | } |
227 | 249 | ||
250 | + this.cacheMouthDetailResult[`${this.year}:${this.month}:${this.page}`] = monthDetailPage; | ||
228 | return; | 251 | return; |
229 | } | 252 | } |
230 | 253 |
@@ -49,6 +49,8 @@ $(document).ajaxError((event, xhr) => { | @@ -49,6 +49,8 @@ $(document).ajaxError((event, xhr) => { | ||
49 | window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`; | 49 | window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`; |
50 | } | 50 | } |
51 | } | 51 | } |
52 | + } else if (xhr.status === 510 && xhr.responseJSON.data && xhr.responseJSON.data.refer) { | ||
53 | + window.location.href = xhr.responseJSON.data.refer; | ||
52 | } else if (xhr.status === 403 && xhr.responseJSON.code === 4403) { | 54 | } else if (xhr.status === 403 && xhr.responseJSON.code === 4403) { |
53 | tip.show(xhr.responseJSON.message); | 55 | tip.show(xhr.responseJSON.message); |
54 | setTimeout(function() { | 56 | setTimeout(function() { |
@@ -311,13 +311,13 @@ class ProductListWithFilter { | @@ -311,13 +311,13 @@ class ProductListWithFilter { | ||
311 | $this.addClass('active'); | 311 | $this.addClass('active'); |
312 | this.view.dropList.toggle(); | 312 | this.view.dropList.toggle(); |
313 | this.view.dropList.find('.default').on('touchend touchcancel', (e) => { | 313 | this.view.dropList.find('.default').on('touchend touchcancel', (e) => { |
314 | - this.view.thisLi = $(e.target); | 314 | + this.view.thisLi = $(e.delegateTarget); |
315 | this.view.firstText.html('默认'); | 315 | this.view.firstText.html('默认'); |
316 | this.popularityFilter(this.view.thisLi, 'default'); | 316 | this.popularityFilter(this.view.thisLi, 'default'); |
317 | return false; | 317 | return false; |
318 | }); | 318 | }); |
319 | this.view.dropList.find('.discount').on('touchend touchcancel', (e) => { | 319 | this.view.dropList.find('.discount').on('touchend touchcancel', (e) => { |
320 | - this.view.thisLi = $(e.target); | 320 | + this.view.thisLi = $(e.delegateTarget); |
321 | this.view.firstText.html(this.view.thisLi.data('text')); | 321 | this.view.firstText.html(this.view.thisLi.data('text')); |
322 | this.popularityFilter(this.view.thisLi, 'discount'); | 322 | this.popularityFilter(this.view.thisLi, 'discount'); |
323 | $('.first-li-more').removeClass('new default sale discount').addClass('discount'); | 323 | $('.first-li-more').removeClass('new default sale discount').addClass('discount'); |
@@ -75,18 +75,4 @@ | @@ -75,18 +75,4 @@ | ||
75 | } | 75 | } |
76 | window.addEventListener('load', async_load, false); | 76 | window.addEventListener('load', async_load, false); |
77 | </script> | 77 | </script> |
78 | -<script> | ||
79 | - window._py = window._py||[]; | ||
80 | - window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']); | ||
81 | - window._py.push(['domain','stats.ipinyou.com']); | ||
82 | - window._py.push(['e','']); | ||
83 | - if(typeof _goodsData!='undefined'){ | ||
84 | - window._py.push(['pi',_goodsData]); | ||
85 | - } | ||
86 | - -function(d){ | ||
87 | - var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1; | ||
88 | - c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js'; | ||
89 | - var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h); | ||
90 | - }(document); | ||
91 | -</script> | ||
92 | -</html> | ||
78 | +</html> |
@@ -93,18 +93,4 @@ | @@ -93,18 +93,4 @@ | ||
93 | } | 93 | } |
94 | window.addEventListener('load', async_load, false); | 94 | window.addEventListener('load', async_load, false); |
95 | </script> | 95 | </script> |
96 | -<script> | ||
97 | - window._py = window._py||[]; | ||
98 | - window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']); | ||
99 | - window._py.push(['domain','stats.ipinyou.com']); | ||
100 | - window._py.push(['e','']); | ||
101 | - if(typeof _goodsData!='undefined'){ | ||
102 | - window._py.push(['pi',_goodsData]); | ||
103 | - } | ||
104 | - -function(d){ | ||
105 | - var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1; | ||
106 | - c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js'; | ||
107 | - var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h); | ||
108 | - }(document); | ||
109 | -</script> | ||
110 | -</html> | ||
96 | +</html> |
@@ -107,18 +107,4 @@ | @@ -107,18 +107,4 @@ | ||
107 | } | 107 | } |
108 | window.addEventListener('load', async_load, false); | 108 | window.addEventListener('load', async_load, false); |
109 | </script> | 109 | </script> |
110 | - <script> | ||
111 | - window._py = window._py||[]; | ||
112 | - window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']); | ||
113 | - window._py.push(['domain','stats.ipinyou.com']); | ||
114 | - window._py.push(['e','']); | ||
115 | - if(typeof _goodsData!='undefined'){ | ||
116 | - window._py.push(['pi',_goodsData]); | ||
117 | - } | ||
118 | - -function(d){ | ||
119 | - var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1; | ||
120 | - c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js'; | ||
121 | - var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h); | ||
122 | - }(document); | ||
123 | - </script> | ||
124 | -</html> | ||
110 | +</html> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <head> | 3 | <head> |
4 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | 4 | <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> |
5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | 5 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> |
6 | - <meta http-equiv="Cache-Control" content="no-siteapp" /> | 6 | + <meta http-equiv="Cache-Control" content="no-siteapp" /> |
7 | <meta name="renderer" content="webkit"> | 7 | <meta name="renderer" content="webkit"> |
8 | <meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> | 8 | <meta name="keywords" content="Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款"> |
9 | <meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国潮流商品购物网站。全场品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和国内流行的商品,也是国内原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> | 9 | <meta name="description" content="YOHO! 有货,年轻人潮流购物中心,中国潮流商品购物网站。全场品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和国内流行的商品,也是国内原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。"> |
@@ -102,17 +102,17 @@ | @@ -102,17 +102,17 @@ | ||
102 | <ul class="sub-nav-list"> | 102 | <ul class="sub-nav-list"> |
103 | <li class="sub-nav-item"> | 103 | <li class="sub-nav-item"> |
104 | <a href="http://list.yohobuy.com/new?gender=1,3&order=s_t_desc | 104 | <a href="http://list.yohobuy.com/new?gender=1,3&order=s_t_desc |
105 | -">新品到着 | 105 | +">新品到着 |
106 | </a> | 106 | </a> |
107 | </li> | 107 | </li> |
108 | <li class="sub-nav-item"> | 108 | <li class="sub-nav-item"> |
109 | <a href="http://www.yohobuy.com/brands?gender=1,3 | 109 | <a href="http://www.yohobuy.com/brands?gender=1,3 |
110 | -">品牌一览 | 110 | +">品牌一览 |
111 | </a> | 111 | </a> |
112 | </li> | 112 | </li> |
113 | <li class="sub-nav-item"> | 113 | <li class="sub-nav-item"> |
114 | <a href="http://list.yohobuy.com/?gender=1,3&msort=1,3 | 114 | <a href="http://list.yohobuy.com/?gender=1,3&msort=1,3 |
115 | -">服饰 | 115 | +">服饰 |
116 | </a> | 116 | </a> |
117 | <div class="third-nav-wrapper"> | 117 | <div class="third-nav-wrapper"> |
118 | <div class="third-nav"> | 118 | <div class="third-nav"> |
@@ -257,7 +257,7 @@ | @@ -257,7 +257,7 @@ | ||
257 | </li> | 257 | </li> |
258 | <li class="sub-nav-item"> | 258 | <li class="sub-nav-item"> |
259 | <a href="http://list.yohobuy.com/?gender=1,3&msort=6 | 259 | <a href="http://list.yohobuy.com/?gender=1,3&msort=6 |
260 | -">鞋履 | 260 | +">鞋履 |
261 | </a> | 261 | </a> |
262 | <div class="third-nav-wrapper"> | 262 | <div class="third-nav-wrapper"> |
263 | <div class="third-nav"> | 263 | <div class="third-nav"> |
@@ -394,7 +394,7 @@ | @@ -394,7 +394,7 @@ | ||
394 | </li> | 394 | </li> |
395 | <li class="sub-nav-item"> | 395 | <li class="sub-nav-item"> |
396 | <a href="http://list.yohobuy.com/?gender=1,3&msort=7 | 396 | <a href="http://list.yohobuy.com/?gender=1,3&msort=7 |
397 | -">包袋 | 397 | +">包袋 |
398 | </a> | 398 | </a> |
399 | <div class="third-nav-wrapper"> | 399 | <div class="third-nav-wrapper"> |
400 | <div class="third-nav"> | 400 | <div class="third-nav"> |
@@ -533,7 +533,7 @@ | @@ -533,7 +533,7 @@ | ||
533 | </li> | 533 | </li> |
534 | <li class="sub-nav-item"> | 534 | <li class="sub-nav-item"> |
535 | <a href="http://list.yohobuy.com/?gender=1,3&msort=8 | 535 | <a href="http://list.yohobuy.com/?gender=1,3&msort=8 |
536 | -">配饰 · 其他 | 536 | +">配饰 · 其他 |
537 | </a> | 537 | </a> |
538 | <div class="third-nav-wrapper"> | 538 | <div class="third-nav-wrapper"> |
539 | <div class="third-nav"> | 539 | <div class="third-nav"> |
@@ -658,12 +658,12 @@ | @@ -658,12 +658,12 @@ | ||
658 | </div> | 658 | </div> |
659 | </li> | 659 | </li> |
660 | <li class="sub-nav-item"> | 660 | <li class="sub-nav-item"> |
661 | - <a href="http://guang.yohobuy.com/">逛 | 661 | + <a href="http://guang.yohobuy.com/">逛 |
662 | <span class="newlogo"></span> | 662 | <span class="newlogo"></span> |
663 | </a> | 663 | </a> |
664 | </li> | 664 | </li> |
665 | <li class="sub-nav-item"> | 665 | <li class="sub-nav-item"> |
666 | - <a href="http://list.yohobuy.com/sale?gender=1,3">SALE | 666 | + <a href="http://list.yohobuy.com/sale?gender=1,3">SALE |
667 | </a> | 667 | </a> |
668 | </li> | 668 | </li> |
669 | </ul> | 669 | </ul> |
@@ -679,15 +679,15 @@ | @@ -679,15 +679,15 @@ | ||
679 | <div class='sub-nav-wrapper'> | 679 | <div class='sub-nav-wrapper'> |
680 | <ul class="sub-nav-list"> | 680 | <ul class="sub-nav-list"> |
681 | <li class="sub-nav-item"> | 681 | <li class="sub-nav-item"> |
682 | - <a href="http://list.yohobuy.com/new?gender=2,3&order=s_t_desc">新品到着 | 682 | + <a href="http://list.yohobuy.com/new?gender=2,3&order=s_t_desc">新品到着 |
683 | </a> | 683 | </a> |
684 | </li> | 684 | </li> |
685 | <li class="sub-nav-item"> | 685 | <li class="sub-nav-item"> |
686 | - <a href="http://www.yohobuy.com/brands?gender=2,3">品牌一览 | 686 | + <a href="http://www.yohobuy.com/brands?gender=2,3">品牌一览 |
687 | </a> | 687 | </a> |
688 | </li> | 688 | </li> |
689 | <li class="sub-nav-item"> | 689 | <li class="sub-nav-item"> |
690 | - <a href="http://list.yohobuy.com/?gender=2,3&msort=1,3">服饰 | 690 | + <a href="http://list.yohobuy.com/?gender=2,3&msort=1,3">服饰 |
691 | </a> | 691 | </a> |
692 | <div class="third-nav-wrapper"> | 692 | <div class="third-nav-wrapper"> |
693 | <div class="third-nav"> | 693 | <div class="third-nav"> |
@@ -816,7 +816,7 @@ | @@ -816,7 +816,7 @@ | ||
816 | </div> | 816 | </div> |
817 | </li> | 817 | </li> |
818 | <li class="sub-nav-item"> | 818 | <li class="sub-nav-item"> |
819 | - <a href="http://list.yohobuy.com/?gender=2,3&msort=6">鞋履 | 819 | + <a href="http://list.yohobuy.com/?gender=2,3&msort=6">鞋履 |
820 | </a> | 820 | </a> |
821 | <div class="third-nav-wrapper"> | 821 | <div class="third-nav-wrapper"> |
822 | <div class="third-nav"> | 822 | <div class="third-nav"> |
@@ -944,7 +944,7 @@ | @@ -944,7 +944,7 @@ | ||
944 | </div> | 944 | </div> |
945 | </li> | 945 | </li> |
946 | <li class="sub-nav-item"> | 946 | <li class="sub-nav-item"> |
947 | - <a href="http://list.yohobuy.com/?gender=2,3&msort=7">包袋 | 947 | + <a href="http://list.yohobuy.com/?gender=2,3&msort=7">包袋 |
948 | </a> | 948 | </a> |
949 | <div class="third-nav-wrapper"> | 949 | <div class="third-nav-wrapper"> |
950 | <div class="third-nav"> | 950 | <div class="third-nav"> |
@@ -1060,7 +1060,7 @@ | @@ -1060,7 +1060,7 @@ | ||
1060 | </div> | 1060 | </div> |
1061 | </li> | 1061 | </li> |
1062 | <li class="sub-nav-item"> | 1062 | <li class="sub-nav-item"> |
1063 | - <a href="http://list.yohobuy.com/?gender=2,3&msort=8,10,241">配饰 · 其他 | 1063 | + <a href="http://list.yohobuy.com/?gender=2,3&msort=8,10,241">配饰 · 其他 |
1064 | </a> | 1064 | </a> |
1065 | <div class="third-nav-wrapper"> | 1065 | <div class="third-nav-wrapper"> |
1066 | <div class="third-nav"> | 1066 | <div class="third-nav"> |
@@ -1190,12 +1190,12 @@ | @@ -1190,12 +1190,12 @@ | ||
1190 | </div> | 1190 | </div> |
1191 | </li> | 1191 | </li> |
1192 | <li class="sub-nav-item"> | 1192 | <li class="sub-nav-item"> |
1193 | - <a href="http://guang.yohobuy.com/">逛 | 1193 | + <a href="http://guang.yohobuy.com/">逛 |
1194 | <span class="newlogo"></span> | 1194 | <span class="newlogo"></span> |
1195 | </a> | 1195 | </a> |
1196 | </li> | 1196 | </li> |
1197 | <li class="sub-nav-item"> | 1197 | <li class="sub-nav-item"> |
1198 | - <a href="http://list.yohobuy.com/sale?gender=2,3">SALE | 1198 | + <a href="http://list.yohobuy.com/sale?gender=2,3">SALE |
1199 | </a> | 1199 | </a> |
1200 | </li> | 1200 | </li> |
1201 | </ul> | 1201 | </ul> |
@@ -1211,15 +1211,15 @@ | @@ -1211,15 +1211,15 @@ | ||
1211 | <div class='sub-nav-wrapper'> | 1211 | <div class='sub-nav-wrapper'> |
1212 | <ul class="sub-nav-list"> | 1212 | <ul class="sub-nav-list"> |
1213 | <li class="sub-nav-item"> | 1213 | <li class="sub-nav-item"> |
1214 | - <a href="http://list.yohobuy.com/new?order=s_t_desc&msort=365">新品到着 | 1214 | + <a href="http://list.yohobuy.com/new?order=s_t_desc&msort=365">新品到着 |
1215 | </a> | 1215 | </a> |
1216 | </li> | 1216 | </li> |
1217 | <li class="sub-nav-item"> | 1217 | <li class="sub-nav-item"> |
1218 | - <a href="http://www.yohobuy.com/brands?msort=365">品牌一览 | 1218 | + <a href="http://www.yohobuy.com/brands?msort=365">品牌一览 |
1219 | </a> | 1219 | </a> |
1220 | </li> | 1220 | </li> |
1221 | <li class="sub-nav-item"> | 1221 | <li class="sub-nav-item"> |
1222 | - <a href="http://list.yohobuy.com/?msort=365&misort=396,423,400,404,367,406,430,453,366,417">上装 | 1222 | + <a href="http://list.yohobuy.com/?msort=365&misort=396,423,400,404,367,406,430,453,366,417">上装 |
1223 | </a> | 1223 | </a> |
1224 | <div class="third-nav-wrapper"> | 1224 | <div class="third-nav-wrapper"> |
1225 | <div class="third-nav"> | 1225 | <div class="third-nav"> |
@@ -1364,7 +1364,7 @@ | @@ -1364,7 +1364,7 @@ | ||
1364 | </div> | 1364 | </div> |
1365 | </li> | 1365 | </li> |
1366 | <li class="sub-nav-item"> | 1366 | <li class="sub-nav-item"> |
1367 | - <a href="http://list.yohobuy.com/?msort=365&misort=369,388,384">下装 | 1367 | + <a href="http://list.yohobuy.com/?msort=365&misort=369,388,384">下装 |
1368 | </a> | 1368 | </a> |
1369 | <div class="third-nav-wrapper"> | 1369 | <div class="third-nav-wrapper"> |
1370 | <div class="third-nav"> | 1370 | <div class="third-nav"> |
@@ -1480,7 +1480,7 @@ | @@ -1480,7 +1480,7 @@ | ||
1480 | </div> | 1480 | </div> |
1481 | </li> | 1481 | </li> |
1482 | <li class="sub-nav-item"> | 1482 | <li class="sub-nav-item"> |
1483 | - <a href="http://list.yohobuy.com/?msort=365&misort=368,392,414,421,429,419,408">鞋包配饰 | 1483 | + <a href="http://list.yohobuy.com/?msort=365&misort=368,392,414,421,429,419,408">鞋包配饰 |
1484 | </a> | 1484 | </a> |
1485 | <div class="third-nav-wrapper"> | 1485 | <div class="third-nav-wrapper"> |
1486 | <div class="third-nav"> | 1486 | <div class="third-nav"> |
@@ -1594,12 +1594,12 @@ | @@ -1594,12 +1594,12 @@ | ||
1594 | </div> | 1594 | </div> |
1595 | </li> | 1595 | </li> |
1596 | <li class="sub-nav-item"> | 1596 | <li class="sub-nav-item"> |
1597 | - <a href="http://guang.yohobuy.com/">逛 | 1597 | + <a href="http://guang.yohobuy.com/">逛 |
1598 | <span class="newlogo"></span> | 1598 | <span class="newlogo"></span> |
1599 | </a> | 1599 | </a> |
1600 | </li> | 1600 | </li> |
1601 | <li class="sub-nav-item"> | 1601 | <li class="sub-nav-item"> |
1602 | - <a href="http://list.yohobuy.com/sale?msort=365">SALE | 1602 | + <a href="http://list.yohobuy.com/sale?msort=365">SALE |
1603 | </a> | 1603 | </a> |
1604 | </li> | 1604 | </li> |
1605 | </ul> | 1605 | </ul> |
@@ -1615,15 +1615,15 @@ | @@ -1615,15 +1615,15 @@ | ||
1615 | <div class='sub-nav-wrapper'> | 1615 | <div class='sub-nav-wrapper'> |
1616 | <ul class="sub-nav-list"> | 1616 | <ul class="sub-nav-list"> |
1617 | <li class="sub-nav-item"> | 1617 | <li class="sub-nav-item"> |
1618 | - <a href="http://list.yohobuy.com/new?order=s_t_desc&msort=10">新品到着 | 1618 | + <a href="http://list.yohobuy.com/new?order=s_t_desc&msort=10">新品到着 |
1619 | </a> | 1619 | </a> |
1620 | </li> | 1620 | </li> |
1621 | <li class="sub-nav-item"> | 1621 | <li class="sub-nav-item"> |
1622 | - <a href="http://www.yohobuy.com/brands">品牌一览 | 1622 | + <a href="http://www.yohobuy.com/brands">品牌一览 |
1623 | </a> | 1623 | </a> |
1624 | </li> | 1624 | </li> |
1625 | <li class="sub-nav-item"> | 1625 | <li class="sub-nav-item"> |
1626 | - <a href="http://list.yohobuy.com/?msort=10&misort=103">数码3C | 1626 | + <a href="http://list.yohobuy.com/?msort=10&misort=103">数码3C |
1627 | </a> | 1627 | </a> |
1628 | <div class="third-nav-wrapper"> | 1628 | <div class="third-nav-wrapper"> |
1629 | <div class="third-nav"> | 1629 | <div class="third-nav"> |
@@ -1750,7 +1750,7 @@ | @@ -1750,7 +1750,7 @@ | ||
1750 | </div> | 1750 | </div> |
1751 | </li> | 1751 | </li> |
1752 | <li class="sub-nav-item"> | 1752 | <li class="sub-nav-item"> |
1753 | - <a href="http://list.yohobuy.com/?msort=10&misort=266">居家 | 1753 | + <a href="http://list.yohobuy.com/?msort=10&misort=266">居家 |
1754 | </a> | 1754 | </a> |
1755 | <div class="third-nav-wrapper"> | 1755 | <div class="third-nav-wrapper"> |
1756 | <div class="third-nav"> | 1756 | <div class="third-nav"> |
@@ -1912,7 +1912,7 @@ | @@ -1912,7 +1912,7 @@ | ||
1912 | </div> | 1912 | </div> |
1913 | </li> | 1913 | </li> |
1914 | <li class="sub-nav-item"> | 1914 | <li class="sub-nav-item"> |
1915 | - <a href="http://list.yohobuy.com/?msort=10&misort=101,280">玩具娱乐 | 1915 | + <a href="http://list.yohobuy.com/?msort=10&misort=101,280">玩具娱乐 |
1916 | </a> | 1916 | </a> |
1917 | <div class="third-nav-wrapper"> | 1917 | <div class="third-nav-wrapper"> |
1918 | <div class="third-nav"> | 1918 | <div class="third-nav"> |
@@ -2039,7 +2039,7 @@ | @@ -2039,7 +2039,7 @@ | ||
2039 | </div> | 2039 | </div> |
2040 | </li> | 2040 | </li> |
2041 | <li class="sub-nav-item"> | 2041 | <li class="sub-nav-item"> |
2042 | - <a href="http://list.yohobuy.com/?msort=10&misort=259">美妆 | 2042 | + <a href="http://list.yohobuy.com/?msort=10&misort=259">美妆 |
2043 | </a> | 2043 | </a> |
2044 | <div class="third-nav-wrapper"> | 2044 | <div class="third-nav-wrapper"> |
2045 | <div class="third-nav"> | 2045 | <div class="third-nav"> |
@@ -2140,12 +2140,12 @@ | @@ -2140,12 +2140,12 @@ | ||
2140 | </li> | 2140 | </li> |
2141 | <li class="sub-nav-item"> | 2141 | <li class="sub-nav-item"> |
2142 | <a href="http://guang.yohobuy.com/ | 2142 | <a href="http://guang.yohobuy.com/ |
2143 | -">逛 | 2143 | +">逛 |
2144 | <span class="newlogo"></span> | 2144 | <span class="newlogo"></span> |
2145 | </a> | 2145 | </a> |
2146 | </li> | 2146 | </li> |
2147 | <li class="sub-nav-item"> | 2147 | <li class="sub-nav-item"> |
2148 | - <a href="http://list.yohobuy.com/sale?msort=10">SALE | 2148 | + <a href="http://list.yohobuy.com/sale?msort=10">SALE |
2149 | </a> | 2149 | </a> |
2150 | </li> | 2150 | </li> |
2151 | </ul> | 2151 | </ul> |
@@ -2164,10 +2164,10 @@ | @@ -2164,10 +2164,10 @@ | ||
2164 | </form> | 2164 | </form> |
2165 | </div> | 2165 | </div> |
2166 | <div class="gobuy float-left gobuyboys" id="miniCartBox"> | 2166 | <div class="gobuy float-left gobuyboys" id="miniCartBox"> |
2167 | - | 2167 | + |
2168 | <span class="ic-infomation">0</span> | 2168 | <span class="ic-infomation">0</span> |
2169 | <div class="gobuy-wrapper"></div> | 2169 | <div class="gobuy-wrapper"></div> |
2170 | - | 2170 | + |
2171 | </div> | 2171 | </div> |
2172 | </div> | 2172 | </div> |
2173 | </div> | 2173 | </div> |
@@ -2395,7 +2395,7 @@ | @@ -2395,7 +2395,7 @@ | ||
2395 | </script> | 2395 | </script> |
2396 | </div> | 2396 | </div> |
2397 | <input id="api-domain" type="hidden" value="http://test.open.yohobuy.com"> | 2397 | <input id="api-domain" type="hidden" value="http://test.open.yohobuy.com"> |
2398 | - | 2398 | + |
2399 | <div class="err-page err-404 screen"> | 2399 | <div class="err-page err-404 screen"> |
2400 | <div class="tips-404"> | 2400 | <div class="tips-404"> |
2401 | <p class="tip">很抱歉,您访问的页面不存在!</p> | 2401 | <p class="tip">很抱歉,您访问的页面不存在!</p> |
@@ -2596,7 +2596,7 @@ | @@ -2596,7 +2596,7 @@ | ||
2596 | NewPower Co. 版权所有 经营许可证编号:苏B2-20120395 | 2596 | NewPower Co. 版权所有 经营许可证编号:苏B2-20120395 |
2597 | </p> | 2597 | </p> |
2598 | </div> | 2598 | </div> |
2599 | - | 2599 | + |
2600 | </div> | 2600 | </div> |
2601 | </div> | 2601 | </div> |
2602 | </div> | 2602 | </div> |
@@ -2615,17 +2615,17 @@ | @@ -2615,17 +2615,17 @@ | ||
2615 | <script> | 2615 | <script> |
2616 | seajs.use('js/header'); | 2616 | seajs.use('js/header'); |
2617 | </script> | 2617 | </script> |
2618 | - | ||
2619 | - | ||
2620 | - | ||
2621 | - | ||
2622 | - | ||
2623 | - | ||
2624 | - | ||
2625 | - | ||
2626 | - | ||
2627 | - | ||
2628 | - | 2618 | + |
2619 | + | ||
2620 | + | ||
2621 | + | ||
2622 | + | ||
2623 | + | ||
2624 | + | ||
2625 | + | ||
2626 | + | ||
2627 | + | ||
2628 | + | ||
2629 | <!-- Google Tag Manager --> | 2629 | <!-- Google Tag Manager --> |
2630 | <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> | 2630 | <noscript><iframe src="//www.googletagmanager.com/ns.html?id=GTM-W958MG" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> |
2631 | <script> | 2631 | <script> |
@@ -2641,7 +2641,7 @@ | @@ -2641,7 +2641,7 @@ | ||
2641 | (function() { | 2641 | (function() { |
2642 | _gaq.push(['_setAccount', 'UA-48997038-32']); | 2642 | _gaq.push(['_setAccount', 'UA-48997038-32']); |
2643 | _gaq.push(['_trackPageview']); | 2643 | _gaq.push(['_trackPageview']); |
2644 | - var ga = document.createElement('script'); | 2644 | + var ga = document.createElement('script'); |
2645 | ga.type = 'text/javascript'; ga.async = true; | 2645 | ga.type = 'text/javascript'; ga.async = true; |
2646 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | 2646 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
2647 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | 2647 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
@@ -2686,20 +2686,6 @@ | @@ -2686,20 +2686,6 @@ | ||
2686 | } | 2686 | } |
2687 | })(); | 2687 | })(); |
2688 | </script> | 2688 | </script> |
2689 | - <script> | ||
2690 | - window._py = window._py||[]; | ||
2691 | - window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']); | ||
2692 | - window._py.push(['domain','stats.ipinyou.com']); | ||
2693 | - window._py.push(['e','']); | ||
2694 | - if(typeof _goodsData!='undefined'){ | ||
2695 | - window._py.push(['pi',_goodsData]); | ||
2696 | - } | ||
2697 | - -function(d){ | ||
2698 | - var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1; | ||
2699 | - c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js'; | ||
2700 | - var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h); | ||
2701 | - }(document); | ||
2702 | - </script> | ||
2703 | <script src="http://static.yohobuy.com/js/v3/o_code.js?v=20150420" async="async"></script> | 2689 | <script src="http://static.yohobuy.com/js/v3/o_code.js?v=20150420" async="async"></script> |
2704 | </body> | 2690 | </body> |
2705 | </html> | 2691 | </html> |
@@ -340,6 +340,9 @@ const getSearchParamsWithoutMethod = (params) => { | @@ -340,6 +340,9 @@ const getSearchParamsWithoutMethod = (params) => { | ||
340 | if (params.physical_channel) { | 340 | if (params.physical_channel) { |
341 | finalParams.physical_channel = params.physical_channel; | 341 | finalParams.physical_channel = params.physical_channel; |
342 | } | 342 | } |
343 | + if (params.from) { | ||
344 | + finalParams.from = params.from; | ||
345 | + } | ||
343 | 346 | ||
344 | finalParams = _.mapValues(finalParams, value => { | 347 | finalParams = _.mapValues(finalParams, value => { |
345 | return stringProcess.decodeURIComponent(value); | 348 | return stringProcess.decodeURIComponent(value); |
-
Please register or login to post a comment