Authored by 郭成尧

query-decode

... ... @@ -3,6 +3,7 @@
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2016/7/29
*/
const logger = global.yoho.logger;
const _ = require('lodash');
/**
... ... @@ -215,7 +216,14 @@ const getSearchParamsWithoutMethod = (params) => {
};
if (params.query) { // 模糊查询参数
finalParams.query = params.query.replace(/\+/g, ',');
let queryString = '';
try {
queryString = decodeURIComponent(params.query).replace(/\+/g, ',');
} catch (e) {
logger.error('decodeURIComponent params query: ' + e);
}
finalParams.query = queryString;
}
if (params.yh_channel || params.channel) { // 频道
finalParams.yh_channel = params.yh_channel || getChannelType(params.channel);
... ...