Authored by yyq

店铺跳转

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