修复回归安全问题并补充验证
This commit is contained in:
@@ -7,13 +7,5 @@ module.exports = {
|
||||
method: 'POST',
|
||||
data: {}
|
||||
})
|
||||
},
|
||||
|
||||
mockOrderPaymentSuccess(orderId) {
|
||||
return request({
|
||||
url: `/payment/order/${orderId}/mock-success`,
|
||||
method: 'POST',
|
||||
data: {}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ const afterSaleApi = require('./after-sale')
|
||||
const growthApi = require('./growth')
|
||||
|
||||
paymentApi.prepareOrderPayment(12)
|
||||
paymentApi.mockOrderPaymentSuccess(12)
|
||||
afterSaleApi.applyAfterSale({ orderId: 12, reason: 'need refund' })
|
||||
afterSaleApi.getMyAfterSales({ page: 2, size: 5 })
|
||||
growthApi.getGrowthSummary()
|
||||
@@ -32,19 +31,14 @@ assert.deepStrictEqual(calls[0], {
|
||||
data: {}
|
||||
})
|
||||
assert.deepStrictEqual(calls[1], {
|
||||
url: '/payment/order/12/mock-success',
|
||||
method: 'POST',
|
||||
data: {}
|
||||
})
|
||||
assert.deepStrictEqual(calls[2], {
|
||||
url: '/after-sale/apply',
|
||||
method: 'POST',
|
||||
data: { orderId: 12, reason: 'need refund' }
|
||||
})
|
||||
assert.deepStrictEqual(calls[3], {
|
||||
assert.deepStrictEqual(calls[2], {
|
||||
url: '/after-sale/my',
|
||||
params: { page: 2, size: 5 }
|
||||
})
|
||||
assert.deepStrictEqual(calls[4], {
|
||||
assert.deepStrictEqual(calls[3], {
|
||||
url: '/growth/summary'
|
||||
})
|
||||
|
||||
@@ -864,9 +864,9 @@ Page({
|
||||
})
|
||||
const confirmed = await new Promise(resolve => {
|
||||
wx.showModal({
|
||||
title: '模拟支付',
|
||||
content: `本次需支付 ${order.paymentInfo.amountText},确认模拟支付成功吗?`,
|
||||
confirmText: '确认支付',
|
||||
title: '准备支付',
|
||||
content: `本次需支付 ${order.paymentInfo.amountText},支付单准备后请等待正式支付接入。`,
|
||||
confirmText: '知道了',
|
||||
success: res => resolve(Boolean(res.confirm)),
|
||||
fail: () => resolve(false)
|
||||
})
|
||||
@@ -874,11 +874,8 @@ Page({
|
||||
if (!confirmed) {
|
||||
return
|
||||
}
|
||||
await runWithLoading(() => paymentApi.mockOrderPaymentSuccess(orderId), {
|
||||
title: '确认支付'
|
||||
})
|
||||
wx.showToast({
|
||||
title: '支付已确认',
|
||||
title: '支付单已准备',
|
||||
icon: 'none'
|
||||
})
|
||||
await this.loadOrders()
|
||||
|
||||
Reference in New Issue
Block a user