Authored by 刘传洋

add cache time

... ... @@ -73,20 +73,20 @@ const getProductList = (params) => {
if(cdata.filter && cdata.standard) {
hasCache= true;
finalParams.need_filter= 'no';
finalParams.need_filter= 'no';
}
}
return yohoApi.get('', finalParams).then(result => {
if(hasCache && result && result.data) {
Object.assign(result.data, cdata);
Object.assign(result.data, cdata);
} else {
if(result && result.data && result.data.filter) {
cache.set(cKey, Object.assign({}, {
filter: result.data.filter,
standard: result.data.standard
}));
}), 3600);
}
}
return result;
... ... @@ -127,7 +127,7 @@ const getSortList = (params) => {
return yohoApi.get('', finalParams).then(ret => {
if(ret && ret.code === 200) {
cache.set(cKey, ret);
cache.set(cKey, ret, 3600);
}
return ret;
});
... ... @@ -243,10 +243,10 @@ const getBrandShop = (query) => {
return yohoApi.get('', finalParams).then(ret => {
if (ret && ret.code === 200) {
cache.set(cKey, ret.data);
cache.set(cKey, ret.data, 3600);
return ret.data;
}
});return
});return
}
});
};
... ... @@ -280,7 +280,7 @@ const getShopsByBrandId = bid => {
return yohoApi.get('', finalParams).then(ret => {
if (ret && ret.code === 200) {
cache.set(cKey, ret.data);
cache.set(cKey, ret.data, 3600);
return ret.data;
}
});
... ...