Showing
3 changed files
with
5 additions
and
1 deletions
@@ -45,7 +45,7 @@ router.post('/ticketCompute', auth, ticket.ticketCompute); | @@ -45,7 +45,7 @@ router.post('/ticketCompute', auth, ticket.ticketCompute); | ||
45 | router.get('/cart', cart.cart); | 45 | router.get('/cart', cart.cart); |
46 | router.post('/cart/select', cart.selectProduct); | 46 | router.post('/cart/select', cart.selectProduct); |
47 | router.post('/cart/modifyNum', cart.modifyProductNum); | 47 | router.post('/cart/modifyNum', cart.modifyProductNum); |
48 | -router.post('/cart/add', cart.cartAdd); | 48 | +router.post('/cart/add', auth, cart.cartAdd); |
49 | router.post('/cart/updateProduct', cart.modifyProduct); | 49 | router.post('/cart/updateProduct', cart.modifyProduct); |
50 | router.post('/cart/remove', cart.removeProduct); | 50 | router.post('/cart/remove', cart.removeProduct); |
51 | router.post('/cart/fav', cart.moveToFav); | 51 | router.post('/cart/fav', cart.moveToFav); |
@@ -276,6 +276,8 @@ function addcart(data, cookieList) { | @@ -276,6 +276,8 @@ function addcart(data, cookieList) { | ||
276 | path: '/' | 276 | path: '/' |
277 | }); | 277 | }); |
278 | } | 278 | } |
279 | + } else if ((d.code === 400 || d.code === 401) && d.data && d.data.refer) { | ||
280 | + location.href = d.data.refer; | ||
279 | } else { | 281 | } else { |
280 | new Alert(!d.message ? '加入购物车失败哦~~' : d.message).show(); | 282 | new Alert(!d.message ? '加入购物车失败哦~~' : d.message).show(); |
281 | } | 283 | } |
@@ -189,6 +189,8 @@ function addBundle(params) { | @@ -189,6 +189,8 @@ function addBundle(params) { | ||
189 | 189 | ||
190 | return $.Deferred().resolve(data).promise(); // eslint-disable-line | 190 | return $.Deferred().resolve(data).promise(); // eslint-disable-line |
191 | 191 | ||
192 | + } else if ((code === 400 || code === 401) && data.data && data.data.refer) { | ||
193 | + location.href = data.data.refer; | ||
192 | } else { | 194 | } else { |
193 | 195 | ||
194 | alert = new Alert(data.message); | 196 | alert = new Alert(data.message); |
-
Please register or login to post a comment