Authored by 周少峰

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

Hotfix/search query code wrong



See merge request !63
... ... @@ -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}&`;
}
});
... ... @@ -1598,6 +1599,11 @@ exports.getSearchParams = params => {
nparams.price = nmp.join(',');
}
// 对可能有中文的情况进行处理
if (params.query) {
params.query = decodeURIComponent(params.query);
}
return Object.assign({}, params, nparams);
};
... ...