...
|
...
|
@@ -18,7 +18,6 @@ exports.index = (req, res, next) => { |
|
|
if (result.code === 200) {
|
|
|
|
|
|
res.header('Cache-Control', 'no-store');
|
|
|
|
|
|
res.display('cart', _.merge({
|
|
|
module: 'shopping',
|
|
|
page: 'cart',
|
...
|
...
|
@@ -135,7 +134,7 @@ exports.addToCart = (req, res, next) => { |
|
|
shoppingKey: req.cookies._SPK || null,
|
|
|
uid: req.user.uid
|
|
|
}).then((result) => {
|
|
|
res.cookie('_SPK', result.data.shopping_key, { maxAge: 1000 * 60 * 60 * 24 * 365, httpOnly: true, path: '/'});
|
|
|
res.cookie('_SPK', result.data.shopping_key, {maxAge: 1000 * 60 * 60 * 24 * 365, httpOnly: true, path: '/'});
|
|
|
res.json(result);
|
|
|
}).catch(next);
|
|
|
};
|
...
|
...
|
@@ -165,6 +164,9 @@ exports.toggleSelectGoods = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
cartModel.toggleSelectGoods(params).then(result => {
|
|
|
|
|
|
console.log(result)
|
|
|
|
|
|
res.json(_.merge(cartModel.filterCartData(result, uid), {code: result.code, message: result.message}));
|
|
|
}).catch(next);
|
|
|
};
|
...
|
...
|
|