Authored by htoooth

健状性增强

... ... @@ -83,28 +83,28 @@ const _getCacheDataByName = (resourceName) => {
*/
const _getProductFavoriteDataAsync = (uid, pid, bid) => {
return co(function*() {
let result = {
product: false,
brand: false
};
if (uid) {
if (pid) {
let productData = yield favoriteProductService.isFavoriteAsync(uid, pid);
if (!uid) {
return result;
}
result.product = productData.code === 200 && productData.data ? true : false;
}
if (pid) {
let productData = yield favoriteProductService.isFavoriteAsync(uid, pid);
if (bid) {
let brandData = yield favoriteBrandService.isFavoriteAsync(uid, bid);
result.product = productData.code === 200 && productData.data ? true : false;
}
result.brand = brandData.code && brandData.code === 200 ? true : false;
}
if (bid) {
let brandData = yield favoriteBrandService.isFavoriteAsync(uid, bid);
result.brand = brandData.code && brandData.code === 200 ? true : false;
}
return result;
})();
};
... ...