|
@@ -14,66 +14,66 @@ const refund = require(cRoot + '/refund'); |
|
@@ -14,66 +14,66 @@ const refund = require(cRoot + '/refund'); |
14
|
const order = require(cRoot + '/order');
|
14
|
const order = require(cRoot + '/order');
|
15
|
const exchange = require(cRoot + '/exchange');
|
15
|
const exchange = require(cRoot + '/exchange');
|
16
|
const help = require(cRoot + '/help');
|
16
|
const help = require(cRoot + '/help');
|
17
|
-
|
17
|
+const auth = require(`${global.doraemon}/middleware/auth`);
|
18
|
const router = expressRouter();
|
18
|
const router = expressRouter();
|
19
|
|
19
|
|
20
|
// Your controller here
|
20
|
// Your controller here
|
21
|
router.get('/me/', home.index); // 个人中心主页
|
21
|
router.get('/me/', home.index); // 个人中心主页
|
22
|
router.get('/me/userdata', home.userdata); // 个人中心数据
|
22
|
router.get('/me/userdata', home.userdata); // 个人中心数据
|
23
|
|
23
|
|
24
|
-router.get('/me/order', order.orders); // 订单
|
|
|
25
|
-router.get('/me/order/detail', order.orderDetail); // 订单详情
|
|
|
26
|
-router.get('/me/order/cancelreason', order.cancelReason); // 取消订单原因选择
|
24
|
+router.get('/me/order', auth, order.orders); // 订单
|
|
|
25
|
+router.get('/me/order/detail', auth, order.orderDetail); // 订单详情
|
|
|
26
|
+router.get('/me/order/cancelreason', auth, order.cancelReason); // 取消订单原因选择
|
27
|
|
27
|
|
28
|
-router.get('/me/getOrderList', order.getOrderData); // 获取订单数据
|
|
|
29
|
-router.get('/me/get-order', order.getOrderDetailData); // AJAX 获取订单详情数据
|
|
|
30
|
-router.get('/me/getCancelOrderReason', order.getCancelReason); // 获取取消订单原因
|
|
|
31
|
-router.post('/me/cancelOrder', order.cancelOrder); // 取消订单
|
|
|
32
|
-router.post('/me/deleteOrder', order.deleteOrder); // AJAX 删除订单
|
|
|
33
|
-router.post('/me/confirmReceive', order.confirmOrder); // 确认订单
|
28
|
+router.get('/me/getOrderList', auth, order.getOrderData); // 获取订单数据
|
|
|
29
|
+router.get('/me/get-order', auth, order.getOrderDetailData); // AJAX 获取订单详情数据
|
|
|
30
|
+router.get('/me/getCancelOrderReason', auth, order.getCancelReason); // 获取取消订单原因
|
|
|
31
|
+router.post('/me/cancelOrder', auth, order.cancelOrder); // 取消订单
|
|
|
32
|
+router.post('/me/deleteOrder', auth, order.deleteOrder); // AJAX 删除订单
|
|
|
33
|
+router.post('/me/confirmReceive', auth, order.confirmOrder); // 确认订单
|
34
|
|
34
|
|
35
|
-router.get('/me/mycurrency', order.coin); // yoho币
|
|
|
36
|
-router.get('/me/coin-detail', order.getCoinDetail); // ajax yoho币明细
|
35
|
+router.get('/me/mycurrency', auth, order.coin); // yoho币
|
|
|
36
|
+router.get('/me/coin-detail', auth, order.getCoinDetail); // ajax yoho币明细
|
37
|
|
37
|
|
38
|
router.get('/me/service', home.service); // 在线客服
|
38
|
router.get('/me/service', home.service); // 在线客服
|
39
|
// router.get('/help', home.help); // 帮助中心列表页
|
39
|
// router.get('/help', home.help); // 帮助中心列表页
|
40
|
router.get('/help', help.index); // 帮助中心列表页(写死的内容)
|
40
|
router.get('/help', help.index); // 帮助中心列表页(写死的内容)
|
41
|
router.get('/help-detail', help.helpDetail); // 帮助中心详情页(写死的内容)
|
41
|
router.get('/help-detail', help.helpDetail); // 帮助中心详情页(写死的内容)
|
42
|
-router.get('/me/feedback', home.feedback); // 个人中心-意见反馈
|
|
|
43
|
-router.post('/me/save-feedback', home.saveFeedback); // 个人中心-提交意见反馈
|
42
|
+router.get('/me/feedback', auth, home.feedback); // 个人中心-意见反馈
|
|
|
43
|
+router.post('/me/save-feedback', auth, home.saveFeedback); // 个人中心-提交意见反馈
|
44
|
|
44
|
|
45
|
-router.get('/me/collection', favorite.favorite); // 个人中心 - 收藏
|
|
|
46
|
-router.get('/me/collection/favpaging', favorite.favpaging); // 个人中心 - 收藏商品/品牌(翻页)
|
|
|
47
|
-router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商品/品牌(刪除)
|
45
|
+router.get('/me/collection', auth, favorite.favorite); // 个人中心 - 收藏
|
|
|
46
|
+router.get('/me/collection/favpaging', auth, favorite.favpaging); // 个人中心 - 收藏商品/品牌(翻页)
|
|
|
47
|
+router.post('/me/del-favdel', auth, favorite.deletefav); // 个人中心 - 收藏商品/品牌(刪除)
|
48
|
|
48
|
|
49
|
// 退换货
|
49
|
// 退换货
|
50
|
-router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表
|
|
|
51
|
-router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据
|
|
|
52
|
-router.get('/me/return/refund/detail/:applyId', refund.refundStatus); // 退换货 - 退货状态
|
|
|
53
|
-router.get('/me/return/exchange/detail/:applyId', refund.exchangeStatus); // 退换货 - 换货状态
|
|
|
54
|
-router.get('/me/return/status-detail', refund.statusDetail); // 退换货 - 状态详细信息
|
50
|
+router.get('/me/return', auth, refund.refundOrders); // 退换货 - 订单列表
|
|
|
51
|
+router.get('/me/return/getOrderList', auth, refund.getRefundOrders); // 退换货 - 获取订单列表数据
|
|
|
52
|
+router.get('/me/return/refund/detail/:applyId', auth, refund.refundStatus); // 退换货 - 退货状态
|
|
|
53
|
+router.get('/me/return/exchange/detail/:applyId', auth, refund.exchangeStatus); // 退换货 - 换货状态
|
|
|
54
|
+router.get('/me/return/status-detail', auth, refund.statusDetail); // 退换货 - 状态详细信息
|
55
|
|
55
|
|
56
|
// 退货申请
|
56
|
// 退货申请
|
57
|
-router.get('/me/return/refund', refund.refund); // 退货申请
|
|
|
58
|
-router.get('/me/return/refund/order', refund.order); // AJAX 查询订单数据
|
|
|
59
|
-router.post('/me/return/refund/submit', refund.submit); // AJAX 提交信息
|
|
|
60
|
-router.get('/me/return/logistics', refund.logistics); // 退换货 - 商品寄回信息
|
|
|
61
|
-router.post('/me/return/save-logistics', refund.saveLogistics); // 退换货 - 添加寄回物流信息
|
|
|
62
|
-router.post('/me/return/refund/cancel-apply', refund.cancelApply); // 退货 - 取消申请
|
57
|
+router.get('/me/return/refund', auth, refund.refund); // 退货申请
|
|
|
58
|
+router.get('/me/return/refund/order', auth, refund.order); // AJAX 查询订单数据
|
|
|
59
|
+router.post('/me/return/refund/submit', auth, refund.submit); // AJAX 提交信息
|
|
|
60
|
+router.get('/me/return/logistics', auth, refund.logistics); // 退换货 - 商品寄回信息
|
|
|
61
|
+router.post('/me/return/save-logistics', auth, refund.saveLogistics); // 退换货 - 添加寄回物流信息
|
|
|
62
|
+router.post('/me/return/refund/cancel-apply', auth, refund.cancelApply); // 退货 - 取消申请
|
63
|
|
63
|
|
64
|
// 换货申请
|
64
|
// 换货申请
|
65
|
-router.get('/me/return/exchange', exchange.exchange);
|
|
|
66
|
-router.get('/me/return/exchange/order', exchange.order); // AJAX 获取订单 商品
|
|
|
67
|
-router.get('/me/return/exchange/delivery', exchange.delivery); // AJAX 获取 退货方式
|
|
|
68
|
-router.post('/me/return/exchange/submit', exchange.submit); // AJAX 提交换货 申请
|
|
|
69
|
-router.post('/me/return/exchange/cancel-apply', exchange.cancelApply); // AJAX 取消换货申请
|
65
|
+router.get('/me/return/exchange', auth, exchange.exchange);
|
|
|
66
|
+router.get('/me/return/exchange/order', auth, exchange.order); // AJAX 获取订单 商品
|
|
|
67
|
+router.get('/me/return/exchange/delivery', auth, exchange.delivery); // AJAX 获取 退货方式
|
|
|
68
|
+router.post('/me/return/exchange/submit', auth, exchange.submit); // AJAX 提交换货 申请
|
|
|
69
|
+router.post('/me/return/exchange/cancel-apply', auth, exchange.cancelApply); // AJAX 取消换货申请
|
70
|
|
70
|
|
71
|
-router.get('/me/mydetails', home.mydetails); // 个人信息
|
|
|
72
|
-router.post('/me/save-mydetails', home.saveMydetails); // AJAX 保存个人信息
|
71
|
+router.get('/me/mydetails', auth, home.mydetails); // 个人信息
|
|
|
72
|
+router.post('/me/save-mydetails', auth, home.saveMydetails); // AJAX 保存个人信息
|
73
|
|
73
|
|
74
|
router.get('/me/about', home.about); // 个人中心 - 关于我们
|
74
|
router.get('/me/about', home.about); // 个人中心 - 关于我们
|
75
|
|
75
|
|
76
|
-router.get('/me/logistic', order.logistic); // 个人中心 - 退换货物流设置页面
|
|
|
77
|
-router.get('/me/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据
|
76
|
+router.get('/me/logistic', auth, order.logistic); // 个人中心 - 退换货物流设置页面
|
|
|
77
|
+router.get('/me/get-order-logistic-date', auth, order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据
|
78
|
|
78
|
|
79
|
-module.exports = router; |
79
|
+module.exports = router; |