...
|
...
|
@@ -189,18 +189,35 @@ exports.getFilterData = (params) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const getUserProfile = (uid) => {
|
|
|
return api.get('', sign.apiSign({
|
|
|
method: 'app.passport.profile',
|
|
|
uid: uid
|
|
|
}), true);
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 获取商品数据
|
|
|
*/
|
|
|
exports.getSearchData = (params) => {
|
|
|
return searchSales(params).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return productProcess.processProductList(result.data.product_list || []);
|
|
|
} else {
|
|
|
logger.error('SALE 商品搜索返回 code 不是 200');
|
|
|
return {};
|
|
|
}
|
|
|
});
|
|
|
exports.getSearchData = (params, uid) => {
|
|
|
return Promise.all([
|
|
|
searchSales(params).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return productProcess.processProductList(result.data.product_list || []);
|
|
|
} else {
|
|
|
logger.error('SALE 商品搜索返回 code 不是 200');
|
|
|
return [];
|
|
|
}
|
|
|
}),
|
|
|
getUserProfile(uid).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
return camelCase(result.data.vip_info);
|
|
|
} else {
|
|
|
logger.error('获取用户信息返回 code 不是 200');
|
|
|
return {};
|
|
|
}
|
|
|
})
|
|
|
]);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
|