...
|
...
|
@@ -8,6 +8,7 @@ |
|
|
|
|
|
const router = require('express').Router(); // eslint-disable-line
|
|
|
const cRoot = './controllers';
|
|
|
const auth = require(`${global.middleware}/auth`);
|
|
|
|
|
|
const cartCtrl = require(`${cRoot}/cart`); // 购物车
|
|
|
const order = require(`${cRoot}/order`); // 下单
|
...
|
...
|
@@ -22,8 +23,8 @@ router.get('/cart/product/:productId/edit', cartCtrl.editProduct); |
|
|
router.post('/cart/add', cartCtrl.addToCart);
|
|
|
|
|
|
// 结算
|
|
|
router.get('/order', order.index);
|
|
|
router.get('/order/compute', order.compute);
|
|
|
router.post('/order/submit', order.orderSub);
|
|
|
router.get('/order', auth, order.index);
|
|
|
router.get('/order/compute', auth, order.compute);
|
|
|
router.post('/order/submit', auth, order.orderSub);
|
|
|
|
|
|
module.exports = router; |
...
|
...
|
|