Authored by 陈峰

Merge branch 'feature/cart' into 'release/5.4.1'

秒杀接口挂掉优化



See merge request !272
... ... @@ -39,6 +39,10 @@ exports.ensure = (req, res, next) => {
uid
};
let skillData = yield seckillModel.skillData(skn); // 根据skn查活动信息
let view = {
orderEnsure: false,
message: ''
};
skillData = skillData.data;
... ... @@ -51,7 +55,15 @@ exports.ensure = (req, res, next) => {
skillData &&
skillData.secKillSku.some(obj => obj.productSku === sku) // skn has sku;
)) {
return Promise.reject('活动不存在');
view.message = '挤爆啦,系统繁忙';
return res.render('order-ensure', Object.assign({
module: 'cart',
page: 'seckill',
pageHeader: headerModel.setNav({
navTitle: '确认订单',
backUrl: '/product/show_' + skn + '.html'
}),
}, view));
}
paymentOption.activity_id = activityId = skillData.activityId;
... ... @@ -68,7 +80,6 @@ exports.ensure = (req, res, next) => {
// 获取结算 数据
let paymentInfo = yield seckillModel.payment(paymentOption, orderInfo, orderComputerData.data);
let view;
if (paymentInfo.code !== 200) {
view = {
... ...