...
|
...
|
@@ -9,8 +9,7 @@ const express = require('express'); |
|
|
const router = express.Router(); // eslint-disable-line
|
|
|
const cRoot = './controllers';
|
|
|
const captcha = require('../passport/controllers/captcha');
|
|
|
const csrf = require('../../doraemon/middleware/csrf')();
|
|
|
|
|
|
const csrf = require('../../doraemon/middleware/csrf');
|
|
|
|
|
|
const newUserController = require(`${cRoot}/new-user`);
|
|
|
|
...
|
...
|
@@ -52,7 +51,7 @@ const meGiftController = require(`${cRoot}/me-gift`); |
|
|
|
|
|
|
|
|
// 首页
|
|
|
router.get(['/index', '/'], tabsMiddleware.getCommonHeaderNew, indexController.index);
|
|
|
router.get(['/index', '/'], csrf, tabsMiddleware.getCommonHeaderNew, indexController.index);
|
|
|
router.get('/index/newsAvatar', indexController.newsAvatar);
|
|
|
router.get('/index/async', indexController.asyncData);
|
|
|
|
...
|
...
|
@@ -142,25 +141,25 @@ router.get('/favorite/cancel', favoriteController.cancel); |
|
|
/** ******************************* 我的收藏结束 *****************************************/
|
|
|
|
|
|
/** ******************************* 我的订单开始 *****************************************/
|
|
|
router.get('/orders', tabsMiddleware.getCommonHeader, ordersController.index);
|
|
|
router.get('/orders', csrf, tabsMiddleware.getCommonHeader, ordersController.index);
|
|
|
|
|
|
// 重新加入购物车
|
|
|
router.post('/orders/readd', ordersController.reBuy);
|
|
|
|
|
|
// 删除订单
|
|
|
router.post('/orders/delorder', ordersController.del);
|
|
|
router.post('/orders/delorder', csrf, ordersController.del);
|
|
|
|
|
|
// 修改地址
|
|
|
router.post('/orders/modifyAddress', ordersController.modifyAddress);
|
|
|
router.post('/orders/modifyAddress', csrf, ordersController.modifyAddress);
|
|
|
|
|
|
// 确认订单
|
|
|
router.post('/orders/confirmOrder', ordersController.confirm);
|
|
|
|
|
|
// 取消订单
|
|
|
router.post('/orders/cancelOrder', ordersController.cancel);
|
|
|
router.post('/orders/cancelOrder', csrf, ordersController.cancel);
|
|
|
|
|
|
// 订单详情
|
|
|
router.get('/orders/detail', tabsMiddleware.getCommonHeader, ordersController.detail);
|
|
|
router.get('/orders/detail', csrf, tabsMiddleware.getCommonHeader, ordersController.detail);
|
|
|
|
|
|
// 物流信息
|
|
|
router.get('/orders/express', ordersController.express);
|
...
|
...
|
@@ -177,15 +176,15 @@ router.get('/orders/refundreason', ordersController.refundReason); |
|
|
// router.get('/coupons', CouponsController.index);
|
|
|
router.get('/user', csrf, tabsMiddleware.getCommonHeader, UserController.index);
|
|
|
|
|
|
router.post('/user/edituserinfo', UserController.editUserInfo);
|
|
|
router.post('/user/edituserinfo', csrf, UserController.editUserInfo);
|
|
|
|
|
|
router.post('/user/editusercontactinfo', UserController.editUserContactInfo);
|
|
|
router.post('/user/editusercontactinfo', csrf, UserController.editUserContactInfo);
|
|
|
|
|
|
router.post('/user/edituserhabitsinfo', UserController.editUserHabitsInfo);
|
|
|
router.post('/user/edituserhabitsinfo', csrf, UserController.editUserHabitsInfo);
|
|
|
|
|
|
router.post('/user/edituserlikebrand', UserController.editUserLikeBrand);
|
|
|
router.post('/user/edituserlikebrand', csrf, UserController.editUserLikeBrand);
|
|
|
|
|
|
router.post('/user/isbrandname', UserController.isBrandName);
|
|
|
router.post('/user/isbrandname', csrf, UserController.isBrandName);
|
|
|
|
|
|
// 二维码登录
|
|
|
// router.post('/passport/login/qrcode/refresh', bindController.local.qrcode.refresh); // 刷新二维码
|
...
|
...
|
@@ -256,17 +255,17 @@ router.post('/account/mobilecheck', AccountController.newBindCheck); |
|
|
|
|
|
// 地址管理
|
|
|
|
|
|
router.get('/address', tabsMiddleware.getCommonHeader, AddressController.index);
|
|
|
router.get('/address', csrf, tabsMiddleware.getCommonHeader, AddressController.index);
|
|
|
|
|
|
router.get('/address/area', UserController.getProviceList);
|
|
|
|
|
|
router.post('/address/editAddress', AddressController.editAddress);
|
|
|
|
|
|
router.post('/address/saveAddress', AddressController.saveAddress);
|
|
|
router.post('/address/saveAddress', csrf, AddressController.saveAddress);
|
|
|
|
|
|
router.get('/address/delAddress', AddressController.delAddress);
|
|
|
router.get('/address/delAddress', csrf, AddressController.delAddress);
|
|
|
|
|
|
router.post('/address/defaultAddress', AddressController.defaultAddress);
|
|
|
router.post('/address/defaultAddress', csrf, AddressController.defaultAddress);
|
|
|
|
|
|
// 兑换礼品卡
|
|
|
|
...
|
...
|
|