Authored by jinhu.tung

get uid

... ... @@ -11,7 +11,7 @@ const _ = require('lodash');
exports.index = (req, res) => {
const shoppingKey = req.cookies._SPK || null;
const uid = req.cookies.uid || null;
const uid = req.user.uid || null;
cartModel.getCartData(shoppingKey, uid).then((result) => {
if (result.code === 200) {
... ... @@ -96,7 +96,7 @@ exports.changeProductNum = (req, res) => {
// 删除商品
exports.removeProduct = (req, res) => {
const params = {};
const uid = req.cookies.uid;
const uid = req.user.uid;
const shoppingKey = req.cookies._SPK;
const productSkuList = req.body.skuList;
... ... @@ -154,7 +154,7 @@ exports.addToCart = (req, res) => {
productSku: productSku,
buyNumber: buyNumber,
shoppingKey: req.cookies._SPK || null,
uid: req.cookies.uid
uid: req.user.uid
}).then((result) => {
res.json(result);
});
... ... @@ -163,7 +163,7 @@ exports.addToCart = (req, res) => {
// 购物车商品选择与取消选择
exports.toggleSelectGoods = (req, res) => {
const params = {};
const uid = req.cookies.uid;
const uid = req.user.uid;
const shoppingKey = req.cookies._SPK;
// 商品sku列表
... ... @@ -191,7 +191,7 @@ exports.toggleSelectGoods = (req, res) => {
// 购物车商品选择与取消选择
exports.modifyProductNum = (req, res) => {
const uid = req.cookies.uid;
const uid = req.user.uid;
const shoppingKey = req.cookies._SPK;
const changeType = req.body.changeType;
const changeNum = req.body.changeNum;
... ...