|
|
|
|
|
'use strict';
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
const mRoot = '../models';
|
|
|
const shopModel = require(`${mRoot}/shop-service`);
|
|
|
const tdk = require('../../../utils/getTDK');
|
...
|
...
|
@@ -9,9 +10,12 @@ const tdk = require('../../../utils/getTDK'); |
|
|
exports.index = (req, res, next) => {
|
|
|
let domain = req.query.domain;
|
|
|
let shopId = req.query.shopId;
|
|
|
let shopInfo = req.params.shopInfo;
|
|
|
|
|
|
if (!domain) {
|
|
|
return next();
|
|
|
if (shopInfo) {
|
|
|
shopId = _.last(_.split(shopInfo, '-'));
|
|
|
domain = shopInfo.replace(`-${shopId}`, '');
|
|
|
req.query.shopId = shopId;
|
|
|
}
|
|
|
|
|
|
if (req.xhr && req.query._pjax && shopId) {
|
...
|
...
|
|