Authored by yyq

Merge branch 'feature/searchTerms' into release/5.5

... ... @@ -145,8 +145,8 @@ const searchHistory = (req, res) => {
});
ResData['data'] = data; //eslint-disable-line
res.type('text/plain');
res.send(JSON.stringify(ResData));
res.type('text/javascript');
res.send(req.query.callback + '(' + JSON.stringify(ResData) + ')');
};
... ...
... ... @@ -909,9 +909,12 @@ function actionAddKeyWords() {
*/
function searchSuggestHistory() {
var param = {
return_type: 'jsonp',
query: encodeURIComponent($searchKey.val()) || ''
};
$.getJSON('//search.yohobuy.com/product/search/history?query=' +
encodeURIComponent($searchKey.val()), function(jsonData) {
$.getJSON('//search.yohobuy.com/product/search/history?callback=?', param, function(jsonData) {
if ($searchKey.val() === '') {
... ... @@ -941,7 +944,7 @@ function searchSuggestHistory() {
* @return {[type]} [description]
*/
$searchKey.mouseenter(function() {
$searchKey.focus(function() {
var val = $.trim($(this).val());
... ...
location ~ / {
proxy_redirect off;
proxy_pass http://yohobuy-node;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Accept-Encoding "gzip";
}
... ...