|
@@ -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
|
// 商品详情controller
|
13
|
// 商品详情controller
|
13
|
const detail = require(`${cRoot}/detail`);
|
14
|
const detail = require(`${cRoot}/detail`);
|
|
@@ -45,7 +46,7 @@ router.get('/list', list.index); // 商品列表页 |
|
@@ -45,7 +46,7 @@ router.get('/list', list.index); // 商品列表页 |
45
|
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.showMain); // 商品详情routers
|
46
|
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.showMain); // 商品详情routers
|
46
|
router.get('/detail/comment', detail.indexComment);// 商品评论
|
47
|
router.get('/detail/comment', detail.indexComment);// 商品评论
|
47
|
router.get('/detail/consult', detail.indexConsult);// 商品咨询
|
48
|
router.get('/detail/consult', detail.indexConsult);// 商品咨询
|
48
|
-router.post('/detail/consult', detail.createConsult);// 创建咨询
|
49
|
+router.post('/detail/consult', auth, detail.createConsult);// 创建咨询
|
49
|
router.get('/detail/hotarea', detail.indexHotArea);// 商品热区
|
50
|
router.get('/detail/hotarea', detail.indexHotArea);// 商品热区
|
50
|
router.post('/index/favoriteBrand', favorite.changeFavoriteBrand);// 收藏品牌
|
51
|
router.post('/index/favoriteBrand', favorite.changeFavoriteBrand);// 收藏品牌
|
51
|
router.post('/item/togglecollect', favorite.collectProduct); // 收藏商品
|
52
|
router.post('/item/togglecollect', favorite.collectProduct); // 收藏商品
|