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