Authored by 陈轩

秒杀结算 需要登录

@@ -13,6 +13,8 @@ const authMW = require('../../doraemon/middleware/auth'); @@ -13,6 +13,8 @@ const authMW = require('../../doraemon/middleware/auth');
13 const seckill = require(cRoot + '/seckill'); 13 const seckill = require(cRoot + '/seckill');
14 14
15 // Your controller here 15 // Your controller here
  16 +router.all('/seckill/', authMW);
  17 +router.all('/seckill/*', authMW);
16 router.get('/seckill/', seckill.ensure); 18 router.get('/seckill/', seckill.ensure);
17 router.post('/seckill/compute', seckill.compute); 19 router.post('/seckill/compute', seckill.compute);
18 router.post('/seckill/submit', seckill.submit); 20 router.post('/seckill/submit', seckill.submit);
@@ -8,6 +8,7 @@ @@ -8,6 +8,7 @@
8 const helpers = global.yoho.helpers; 8 const helpers = global.yoho.helpers;
9 9
10 module.exports = (req, res, next) => { 10 module.exports = (req, res, next) => {
  11 + console.log('....')
11 if (!req.user.uid) { 12 if (!req.user.uid) {
12 if (req.xhr) { 13 if (req.xhr) {
13 return res.json({ 14 return res.json({
@@ -14,7 +14,6 @@ module.exports = () => { @@ -14,7 +14,6 @@ module.exports = () => {
14 Object.assign(res.locals, { 14 Object.assign(res.locals, {
15 devHost: devHost 15 devHost: devHost
16 }); 16 });
17 - req.user.uid = '8039759';  
18 17
19 next(); 18 next();
20 }; 19 };