Authored by yyq

brand isfav

... ... @@ -197,10 +197,14 @@ exports.isFavoriteBrand = (req, res, next) => {
let uid = req.user.uid;
let brandId = req.body.brandId;
if (!req.xhr || !req.body.brandId || !uid) {
if (!req.xhr) {
return next();
}
if (!req.body.brandId || !uid) {
res.json({code: 400, message: '用户未登录或缺少参数'});
}
searchApi.isFavoriteBrand(uid, brandId).then(result => {
res.json(result);
}).catch(next);
... ...
... ... @@ -564,7 +564,8 @@ exports.getShopData = (shopId, channel, params, shopInfo) => {
for (let i = 0; i < 3; i++) {
trendList.push({
href: articleList[i].url,
src: articleList[i].src,
src: helpers.getForceSourceUrl(articleList[i].src) +
'?imageView/1/w/{width}/h/{height}',
mainTitle: articleList[i].title,
Subtitle: articleList[i].intro
});
... ...
... ... @@ -7,7 +7,6 @@
module.exports = () => {
return (req, res, next) => {
let searchReg = /^\/product\//;
if (req.subdomains.length) {
... ... @@ -28,7 +27,11 @@ module.exports = () => {
}
break;
case 'list': // 商品列表
req.url = req.path === '/new' ? '/product/list/new' : '/product/list/index';
if (!req.path || req.path === '/') {
req.url = '/product/list/index';
} else if (req.path === '/new') {
req.url = '/product/list/new';
}
break;
case 'sale': // 促销
if (!req.path || req.path === '/') {
... ...