...
|
...
|
@@ -140,20 +140,25 @@ const newDetail = { |
|
|
},
|
|
|
|
|
|
indexData(req, res, next) {
|
|
|
if (!req.xhr) {
|
|
|
return next();
|
|
|
}
|
|
|
if (!req.body.id) {
|
|
|
// for guang
|
|
|
let allowOrigin = _.get(req, 'headers.origin', null) ?
|
|
|
req.headers.origin : req.protocol + '://guang.' + req.headers.host;
|
|
|
|
|
|
res.setHeader('Access-Control-Allow-Origin', allowOrigin);
|
|
|
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
|
|
|
|
if (!req.query.id && !req.query.productSkn) {
|
|
|
return next();
|
|
|
}
|
|
|
|
|
|
let uid = req.user.uid || 0;
|
|
|
let shoppingKey = req.cookies._SPK || '';
|
|
|
|
|
|
detailModel.getNewProductAsyncData(Object.assign({
|
|
|
id: req.body.id,
|
|
|
goodsId: req.body.goodsId,
|
|
|
productSkn: req.body.productSkn,
|
|
|
bundleType: req.body.bundleType,
|
|
|
id: req.query.id,
|
|
|
goodsId: req.query.goodsId,
|
|
|
productSkn: req.query.productSkn,
|
|
|
bundleType: req.query.bundleType,
|
|
|
uid: uid,
|
|
|
shoppingKey: shoppingKey,
|
|
|
ua: req.get('user-agent') || ''
|
...
|
...
|
|