Authored by yyq

店铺跳转

... ... @@ -25,6 +25,11 @@ const shop = (shopId, req, res, next, brandInfo) => {
list.getShopInfo(shopId, req.user.uid).then(shopInfo => {
let pjax = params._pjax;
// 获取不到店铺信息跳转至首页
if (!shopInfo.data || _.isEmpty(shopInfo.data)) {
return res.redirect(helpers.urlFormat('', null, ''));
}
// 比较品牌域名与店铺域名是否一致,不一致跳转至店铺域名
if (!pjax && shopInfo.domain && domain && domain !== _.toLower(shopInfo.domain)) {
res.redirect(helpers.urlFormat('', params, shopInfo.domain));
... ...