// 修改购物车数据
router.post('/cartEdit', (req, res, next) => {
let userId = req.cookies.userId;
let productId = req.body.productId;
let productNum = req.body.productNum;
User.findOneAndUpdate({userId: userId, 'cartList.productId': productId}, {
'cartList.$.productNum': productNum
}, (error, document) => {
if (error) {
res.json({
status: '1',
message: error.message,
result: 'err'
})
} else {
res.json({
status: '0',
message: '',
result: 'suc'
})
}
})
});