...
|
...
|
@@ -46,21 +46,21 @@ module.exports = (req, res, next) => { |
|
|
|
|
|
if (currentShop) {
|
|
|
let baseParams = {
|
|
|
pid: req.session.LOGIN_UID,
|
|
|
founder: req.session.LOGIN_UID,
|
|
|
pid: req.user.uid,
|
|
|
founder: req.user.uid,
|
|
|
shopsId: currentShop.shopsId,
|
|
|
shopId: currentShop.shopsId,
|
|
|
shop: currentShop.shopsId,
|
|
|
supplierId: currentShop.shopsBrands.length ? _.first(currentShop.shopsBrands).supplierId : 0,
|
|
|
platform_id: config.platform,
|
|
|
userId: req.session.LOGIN_UID
|
|
|
userId: req.user.uid
|
|
|
};
|
|
|
let reqParams = Object.assign({
|
|
|
url: apiUrl,
|
|
|
method: req.method.toLowerCase(),
|
|
|
headers: {
|
|
|
'x-shop-id': currentShop.shopsId,
|
|
|
'x-user-id': req.session.LOGIN_UID,
|
|
|
'x-user-id': req.user.uid,
|
|
|
'Content-Type': 'application/json'
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -71,7 +71,7 @@ module.exports = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
if (req.method.toLowerCase() === 'get') {
|
|
|
reqParams.qs = Object.assign(baseParams, req.query, req.body);
|
|
|
reqParams.qs = Object.assign({}, req.query, req.body, baseParams);
|
|
|
} else if (files.length) {
|
|
|
let reqFiles = {};
|
|
|
|
...
|
...
|
|