Authored by 陈轩

save

... ... @@ -20,6 +20,8 @@ exports.ensure = (req, res, next) => {
co(function*() {
let paymentOption = {
buy_number: 1,
yoho_coin_mode: 1,
product_sku: sku,
sku_type: 'S',
uid
... ...
... ... @@ -18,18 +18,18 @@ exports.payment = options => {
}
return result;
})
});
// mock
.catch()
.then(() => {
let mockData = require('./_buynow-mock').payment;
return {
code: 200,
data: paymentProcess.tranformPayment(mockData.data)
};
});
// .catch()
// .then(() => {
// let mockData = require('./_buynow-mock').payment;
// return {
// code: 200,
// data: paymentProcess.tranformPayment(mockData.data)
// };
// });
};
... ... @@ -39,15 +39,15 @@ exports.compute = options => {
method: 'app.Buynow.compute',
}, options);
return API.post(url, queryData)
return API.post(url, queryData);
// mock
.catch()
.then(() => {
let mockData = require('./_buynow-mock').compute;
// .catch()
// .then(() => {
// let mockData = require('./_buynow-mock').compute;
return mockData;
});
// return mockData;
// });
};
... ... @@ -57,13 +57,13 @@ exports.submit = options => {
method: 'app.Buynow.submit'
}, options);
return API.post(url, queryData)
return API.post(url, queryData);
// mock
.catch()
.then(()=> {
let mockData = require('./_buynow-mock').submit;
// .catch()
// .then(()=> {
// let mockData = require('./_buynow-mock').submit;
return mockData;
});
// return mockData;
// });
};
... ...
... ... @@ -12,14 +12,5 @@ exports.skillData = product_skn => {
product_skn
};
return API.post('', queryData)
// mock
.catch()
.then(()=> {
let mock = require('./_seckill-mock').seckillData;
return mock;
});
return API.post('', queryData);
};
... ...
... ... @@ -72,6 +72,7 @@ const index = (req, res, next) => {
};
return seckillModel.queryActivity().then((resultActivity) => {
// console.log(resultActivity)
if (resultActivity.code !== 200) {
return next();
}
... ...
... ... @@ -17,15 +17,7 @@ const mock = require('./seckill-mock');
const queryActivity = () => {
return api.get('', {
method: 'app.seckill.queryActivity'
}, {
cache: true
});
// TODO: REMOVE follow
// .catch()
// .then(() => {
// return _.cloneDeep(mock.activities);
// });
};
/**
... ...