Authored by 周少峰

Merge branch 'hotfix/search-query-code-wrong' into gray

... ... @@ -41,7 +41,8 @@ const handleFilterUrl = (originParam, newParam, delParam) => {
_.forEach(tempOriginParam, function(value, key) {
if (!delParam[key] && value) {
dest += `${key}=${value}&`;
// NOTE: 这里会对 query 进行编码,因为 query 有可以能是中文
dest += key === 'query' ? `${key}=${encodeURIComponent(value)}&` : `${key}=${value}&`;
}
});
... ... @@ -1607,6 +1608,11 @@ exports.getSearchParams = params => {
}
/** 查询参数再处理 **/
// 对可能有中文的情况进行处理
if (params.query) {
params.query = decodeURIComponent(params.query);
}
return Object.assign({}, params, nparams);
};
... ...
... ... @@ -109,7 +109,7 @@ function getShoppingKey() {
a.src = j;
m.parentNode.insertBefore(a, m);
}(window, document, 'script', (document.location.protocol === 'https:' ? 'https:' : 'http:') + '//' + // eslint-disable-line
'cdn.yoho.cn/yas-jssdk/2.2.2/yas.js', '_yas')); // eslint-disable-line
'cdn.yoho.cn/yas-jssdk/2.2.3/yas.js', '_yas')); // eslint-disable-line
(function() {
var uid = getUid();
... ... @@ -119,7 +119,7 @@ function getShoppingKey() {
window._ozuid = uid; // 暴露ozuid
if (window._yas) {
window._yas(1 * new Date(), '2.2.2', 'yohobuy_web', uid, '', '');
window._yas(1 * new Date(), '2.2.3', 'yohobuy_web', uid, '', '');
}
}());
... ...