Authored by yyq

fix seckill

... ... @@ -136,7 +136,7 @@ router.get('/recommend-for-you/cart', recommendForYou.cart);
router.get('/seckill', seckill.index); // 秒杀列表页
router.get('/seckill/list', seckill.indexData);
router.post('/seckill/remind', seckill.remind); // only app; 秒杀提醒
router.post('/seckill/remind', auth, seckill.remind); // only app; 秒杀提醒
router.get('/seckill/get-product-list', seckill.getProductList); // 秒杀列表根据活动id获取商品列表
router.get('/search', search.index); // 搜索主页
... ...
... ... @@ -9,17 +9,17 @@ const helpers = global.yoho.helpers;
module.exports = (req, res, next) => {
if (!req.user.uid) {
if (req.xhr) {
if (req.yoho.isApp) {
return next({
code: 401,
message: 'weblogin'
});
} else if (req.xhr) {
return res.json({
code: 400,
message: '抱歉,您暂未登录!',
redirect: '/signin.html'
});
} else if (req.yoho.isApp) {
return next({
code: 401,
message: 'weblogin'
});
} else {
return res.redirect(helpers.urlFormat('/signin.html', {
refer: req.originalUrl,
... ...