Authored by 刘传洋

Merge branch 'release/newSearch' of http://git.yoho.cn/fe/yohobuy-node into release/newSearch

... ... @@ -194,12 +194,14 @@ exports.getAdnav = (req, res, next) => {
* @return {[type]} [description]
*/
exports.isFavoriteBrand = (req, res, next) => {
let uid = req.user.uid;
let brandId = req.body.brandId;
if (!req.xhr || !req.body.brandId || req.user.id) {
if (!req.xhr || !req.body.brandId || !uid) {
return next();
}
searchApi.isFavoriteBrand(req.user.id, req.body).then(result => {
searchApi.isFavoriteBrand(uid, brandId).then(result => {
res.json(result);
}).catch(next);
};
... ...
... ... @@ -25,7 +25,7 @@ const getSortByConditionAsync = (condition) => {
const adsUrl = '/shops/api/v1/ads/getList';
// 判断用户是否收藏品牌
// const isFavoriteBrandUrl = '/shops/service/v1/favorite/';
const isFavoriteBrandUrl = '/shops/service/v1/favorite/getUidBrandFav';
// 根据品牌查询相关文章
const relateArticleUrl = 'guang/service/v2/article/getArticleByBrand';
... ... @@ -436,8 +436,10 @@ const getBrandData = (params) => {
* @return
*/
const isFavoriteBrand = (uid, brandId) => {
return serviceApi.get('', {uid: uid, brandId: brandId});
return serviceApi.get(isFavoriteBrandUrl, {
uid: uid,
brandId: brandId
});
};
/**
... ...
... ... @@ -859,7 +859,7 @@ exports.handlePathNavData = (data, params, page) => {
{
name: '品牌一览',
pathTitle: '品牌一览',
href: helpers.urlFormat('brand')
href: helpers.urlFormat('/brands')
},
{
name: data.brandNameEn + data.brandNameCn,
... ...