Authored by 郭成尧

ajax-params-handle

... ... @@ -13,6 +13,7 @@ const _ = require('lodash');
const helpers = global.yoho.helpers;
const searchProcess = require(`${utils}/search-process`);
const productProcess = require(`${utils}/product-process`);
const listParamsProcess = require(`${utils}/list-params-process`);
const co = require('bluebird').coroutine;
/**
... ... @@ -218,7 +219,11 @@ exports.search = (req, res, next) => {
res.setHeader('Access-Control-Allow-Origin', allowOrigin);
res.setHeader('Access-Control-Allow-Credentials', 'true');
let params = Object.assign({}, req.query);
let currentUrlParams = listParamsProcess.getParams(req.query.currentUrl);
delete req.query.currentUrl;
let params = Object.assign({}, req.query, currentUrlParams);
let uid = req.user.uid || 0;
if (uid) {
... ...
... ... @@ -527,7 +527,9 @@ function search(opt) {
params.categoryId = categoryId;
}
$.extend(setting, defaultOpt, params);
$.extend(setting, defaultOpt, params, {
currentUrl: location.pathname
});
searching = true;
loading.showLoadingMask();
... ...