Authored by yyq

cart login

... ... @@ -45,7 +45,7 @@ router.post('/ticketCompute', auth, ticket.ticketCompute);
router.get('/cart', cart.cart);
router.post('/cart/select', cart.selectProduct);
router.post('/cart/modifyNum', cart.modifyProductNum);
router.post('/cart/add', cart.cartAdd);
router.post('/cart/add', auth, cart.cartAdd);
router.post('/cart/updateProduct', cart.modifyProduct);
router.post('/cart/remove', cart.removeProduct);
router.post('/cart/fav', cart.moveToFav);
... ...
... ... @@ -276,6 +276,8 @@ function addcart(data, cookieList) {
path: '/'
});
}
} else if ((d.code === 400 || d.code === 401) && d.data && d.data.refer) {
location.href = d.data.refer;
} else {
new Alert(!d.message ? '加入购物车失败哦~~' : d.message).show();
}
... ...
... ... @@ -189,6 +189,8 @@ function addBundle(params) {
return $.Deferred().resolve(data).promise(); // eslint-disable-line
} else if ((code === 400 || code === 401) && data.data && data.data.refer) {
location.href = data.data.refer;
} else {
alert = new Alert(data.message);
... ...