Authored by 姜枫

Merge branch 'release/1.0'

... ... @@ -7,6 +7,7 @@
'use strict';
const router = require('express').Router(); // eslint-disable-line
const auth = require(`${global.doraemon}/middleware/auth`);
var multipart = require('connect-multiparty');
var multipartMiddleware = multipart();
... ... @@ -14,8 +15,8 @@ var multipartMiddleware = multipart();
const uploadApi = require('./controllers/upload.js');
const wechat = require('./controllers/wechat.js');
router.post('/upload/image', multipartMiddleware, uploadApi.uploadImg);
router.post('/upload/image', auth, multipartMiddleware, uploadApi.uploadImg);
router.get('/wechat/share/token', wechat.shareToken);
module.exports = router;
module.exports = router;
\ No newline at end of file
... ...
... ... @@ -9,6 +9,7 @@
const expressRouter = require('express').Router;
const cRoot = './controllers';
const router = expressRouter();
const auth = require(`${global.doraemon}/middleware/auth`);
const editorial = require(`${cRoot}/index`);
... ... @@ -20,8 +21,8 @@ const detail = require(`${cRoot}/detail`);
router.get(/\/([\d]+).html/, detail.index); // 详情routers
router.get(/editorial_(\d+)\.json/, detail.editorial);
router.get(/like_(\d+)\.json/, detail.like);
router.get(/favorite_(\d+)\.json/, detail.favorite);
router.get(/like_(\d+)\.json/, auth, detail.like);
router.get(/favorite_(\d+)\.json/, auth, detail.favorite);
router.get(/misc_(\d+)\.json/, detail.misc);
module.exports = router;
module.exports = router;
\ No newline at end of file
... ...
... ... @@ -14,66 +14,66 @@ const refund = require(cRoot + '/refund');
const order = require(cRoot + '/order');
const exchange = require(cRoot + '/exchange');
const help = require(cRoot + '/help');
const auth = require(`${global.doraemon}/middleware/auth`);
const router = expressRouter();
// Your controller here
router.get('/me/', home.index); // 个人中心主页
router.get('/me/userdata', home.userdata); // 个人中心数据
router.get('/me/order', order.orders); // 订单
router.get('/me/order/detail', order.orderDetail); // 订单详情
router.get('/me/order/cancelreason', order.cancelReason); // 取消订单原因选择
router.get('/me/order', auth, order.orders); // 订单
router.get('/me/order/detail', auth, order.orderDetail); // 订单详情
router.get('/me/order/cancelreason', auth, order.cancelReason); // 取消订单原因选择
router.get('/me/getOrderList', order.getOrderData); // 获取订单数据
router.get('/me/get-order', order.getOrderDetailData); // AJAX 获取订单详情数据
router.get('/me/getCancelOrderReason', order.getCancelReason); // 获取取消订单原因
router.post('/me/cancelOrder', order.cancelOrder); // 取消订单
router.post('/me/deleteOrder', order.deleteOrder); // AJAX 删除订单
router.post('/me/confirmReceive', order.confirmOrder); // 确认订单
router.get('/me/getOrderList', auth, order.getOrderData); // 获取订单数据
router.get('/me/get-order', auth, order.getOrderDetailData); // AJAX 获取订单详情数据
router.get('/me/getCancelOrderReason', auth, order.getCancelReason); // 获取取消订单原因
router.post('/me/cancelOrder', auth, order.cancelOrder); // 取消订单
router.post('/me/deleteOrder', auth, order.deleteOrder); // AJAX 删除订单
router.post('/me/confirmReceive', auth, order.confirmOrder); // 确认订单
router.get('/me/mycurrency', order.coin); // yoho币
router.get('/me/coin-detail', order.getCoinDetail); // ajax yoho币明细
router.get('/me/mycurrency', auth, order.coin); // yoho币
router.get('/me/coin-detail', auth, order.getCoinDetail); // ajax yoho币明细
router.get('/me/service', home.service); // 在线客服
// router.get('/help', home.help); // 帮助中心列表页
router.get('/help', help.index); // 帮助中心列表页(写死的内容)
router.get('/help-detail', help.helpDetail); // 帮助中心详情页(写死的内容)
router.get('/me/feedback', home.feedback); // 个人中心-意见反馈
router.post('/me/save-feedback', home.saveFeedback); // 个人中心-提交意见反馈
router.get('/me/feedback', auth, home.feedback); // 个人中心-意见反馈
router.post('/me/save-feedback', auth, home.saveFeedback); // 个人中心-提交意见反馈
router.get('/me/collection', favorite.favorite); // 个人中心 - 收藏
router.get('/me/collection/favpaging', favorite.favpaging); // 个人中心 - 收藏商品/品牌(翻页)
router.post('/me/del-favdel', favorite.deletefav); // 个人中心 - 收藏商品/品牌(刪除)
router.get('/me/collection', auth, favorite.favorite); // 个人中心 - 收藏
router.get('/me/collection/favpaging', auth, favorite.favpaging); // 个人中心 - 收藏商品/品牌(翻页)
router.post('/me/del-favdel', auth, favorite.deletefav); // 个人中心 - 收藏商品/品牌(刪除)
// 退换货
router.get('/me/return', refund.refundOrders); // 退换货 - 订单列表
router.get('/me/return/getOrderList', refund.getRefundOrders); // 退换货 - 获取订单列表数据
router.get('/me/return/refund/detail/:applyId', refund.refundStatus); // 退换货 - 退货状态
router.get('/me/return/exchange/detail/:applyId', refund.exchangeStatus); // 退换货 - 换货状态
router.get('/me/return/status-detail', refund.statusDetail); // 退换货 - 状态详细信息
router.get('/me/return', auth, refund.refundOrders); // 退换货 - 订单列表
router.get('/me/return/getOrderList', auth, refund.getRefundOrders); // 退换货 - 获取订单列表数据
router.get('/me/return/refund/detail/:applyId', auth, refund.refundStatus); // 退换货 - 退货状态
router.get('/me/return/exchange/detail/:applyId', auth, refund.exchangeStatus); // 退换货 - 换货状态
router.get('/me/return/status-detail', auth, refund.statusDetail); // 退换货 - 状态详细信息
// 退货申请
router.get('/me/return/refund', refund.refund); // 退货申请
router.get('/me/return/refund/order', refund.order); // AJAX 查询订单数据
router.post('/me/return/refund/submit', refund.submit); // AJAX 提交信息
router.get('/me/return/logistics', refund.logistics); // 退换货 - 商品寄回信息
router.post('/me/return/save-logistics', refund.saveLogistics); // 退换货 - 添加寄回物流信息
router.post('/me/return/refund/cancel-apply', refund.cancelApply); // 退货 - 取消申请
router.get('/me/return/refund', auth, refund.refund); // 退货申请
router.get('/me/return/refund/order', auth, refund.order); // AJAX 查询订单数据
router.post('/me/return/refund/submit', auth, refund.submit); // AJAX 提交信息
router.get('/me/return/logistics', auth, refund.logistics); // 退换货 - 商品寄回信息
router.post('/me/return/save-logistics', auth, refund.saveLogistics); // 退换货 - 添加寄回物流信息
router.post('/me/return/refund/cancel-apply', auth, refund.cancelApply); // 退货 - 取消申请
// 换货申请
router.get('/me/return/exchange', exchange.exchange);
router.get('/me/return/exchange/order', exchange.order); // AJAX 获取订单 商品
router.get('/me/return/exchange/delivery', exchange.delivery); // AJAX 获取 退货方式
router.post('/me/return/exchange/submit', exchange.submit); // AJAX 提交换货 申请
router.post('/me/return/exchange/cancel-apply', exchange.cancelApply); // AJAX 取消换货申请
router.get('/me/return/exchange', auth, exchange.exchange);
router.get('/me/return/exchange/order', auth, exchange.order); // AJAX 获取订单 商品
router.get('/me/return/exchange/delivery', auth, exchange.delivery); // AJAX 获取 退货方式
router.post('/me/return/exchange/submit', auth, exchange.submit); // AJAX 提交换货 申请
router.post('/me/return/exchange/cancel-apply', auth, exchange.cancelApply); // AJAX 取消换货申请
router.get('/me/mydetails', home.mydetails); // 个人信息
router.post('/me/save-mydetails', home.saveMydetails); // AJAX 保存个人信息
router.get('/me/mydetails', auth, home.mydetails); // 个人信息
router.post('/me/save-mydetails', auth, home.saveMydetails); // AJAX 保存个人信息
router.get('/me/about', home.about); // 个人中心 - 关于我们
router.get('/me/logistic', order.logistic); // 个人中心 - 退换货物流设置页面
router.get('/me/get-order-logistic-date', order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据
router.get('/me/logistic', auth, order.logistic); // 个人中心 - 退换货物流设置页面
router.get('/me/get-order-logistic-date', auth, order.getOrderLogisticdate); // 个人中心 - 订单物流详情数据
module.exports = router;
module.exports = router;
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@
const expressRouter = require('express').Router;
const cRoot = './controllers';
const router = expressRouter();
const auth = require(`${global.doraemon}/middleware/auth`);
// 产品 搜索 页面
const search = require(`${cRoot}/search`);
... ... @@ -35,7 +36,7 @@ const shop = require(`${cRoot}/shop`);
// router.get('/brand', shop.index); // 品牌 集合页
router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍
router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺
router.post('/product/shop/collect.json', auth, shop.collectShop); // 收藏品牌店铺
router.get('/product/shop/:domain', shop.index); // 品牌店铺页
router.get('/product/shop/:domain/share', shop.shopShare); // 品牌店铺页分享
... ... @@ -46,7 +47,7 @@ router.get(/\/product\/pro_([\d]+)_([\d]+)\/(.*).html/, detail.index); // 商品
router.get(/\/product\/product_([\d]+)\.json/, detail.product);
router.get(/\/product\/intro_([\d]+)\.json/, detail.intro);
router.post(/\product\/cart.json/, detail.addToCart);
router.post(/\product\/favorite.json/, detail.favorite);
router.post(/\product\/favorite.json/, auth, detail.favorite);
router.get(/\/product\/cart-count.json/, detail.getCartCount);
router.get(/\/product\/search_product\.json/, detail.search);
... ... @@ -66,4 +67,4 @@ router.get('/search.json', search.fetchProducts); // ajax
module.exports = router;
module.exports = router;
\ No newline at end of file
... ...
... ... @@ -16,10 +16,8 @@ module.exports = (req, res, next) => {
});
}
return res.redirect(helpers.urlFormat('/signin.html', {
refer: req.originalUrl
}));
return res.redirect('//www.yohoblk.com');
}
next();
};
};
\ No newline at end of file
... ...