Authored by 刘传洋

search jsonp bug

@@ -86,7 +86,7 @@ exports.suggest4Old = (req, res, next) => { @@ -86,7 +86,7 @@ exports.suggest4Old = (req, res, next) => {
86 86
87 exports.serachFilterBrands = (req, res, next) => { 87 exports.serachFilterBrands = (req, res, next) => {
88 search.getBrands4Filter(Object.assign({}, req.query, { 88 search.getBrands4Filter(Object.assign({}, req.query, {
89 - keyword: req.query.query 89 + keyword: req.query.query || ''
90 })).then(result => { 90 })).then(result => {
91 let dest = { 91 let dest = {
92 code: 200, 92 code: 200,
@@ -108,6 +108,11 @@ exports.getBrands4Filter = (params) => { @@ -108,6 +108,11 @@ exports.getBrands4Filter = (params) => {
108 nparams.price = nmp.join(','); 108 nparams.price = nmp.join(',');
109 } 109 }
110 110
  111 + //生成路径包含callback 导致多次调用多个 callback问题
  112 + if(params && params.callback) {
  113 + delete params.callback;
  114 + }
  115 +console.log(JSON.stringify(params));
111 return searchApi.getBrands4Filter(Object.assign({}, params, nparams)).then(result => { 116 return searchApi.getBrands4Filter(Object.assign({}, params, nparams)).then(result => {
112 117
113 let dest = []; 118 let dest = [];