Skip to content

Commit 74e0427

Browse files
committed
【功能优化】支付:查询支付订单时,增加 sync 主动轮询,解决支付宝、微信存在延迟的问题
1 parent da45ee0 commit 74e0427

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/api/pay/order/index.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ export const getOrderPage = async (params: OrderPageReqVO) => {
8484
}
8585

8686
// 查询详情支付订单
87-
export const getOrder = async (id: number) => {
88-
return await request.get({ url: '/pay/order/get?id=' + id })
87+
export const getOrder = async (id: number, sync?: boolean) => {
88+
return await request.get({
89+
url: '/pay/order/get',
90+
params: {
91+
id,
92+
sync
93+
}
94+
})
8995
}
9096

9197
// 获得支付订单的明细

src/views/pay/cashier/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ const getDetail = async () => {
231231
goReturnUrl('cancel')
232232
return
233233
}
234-
const data = await PayOrderApi.getOrder(id.value)
234+
const data = await PayOrderApi.getOrder(id.value, true)
235235
payOrder.value = data
236236
// 1.2 无法查询到支付信息
237237
if (!data) {

0 commit comments

Comments
 (0)