使用wx.openBusinessView拉起支付分小程序时,日志中每天发现一百多条 错误;这个错误我在测试环境没能重现。
{"errCode":-3,"errMsg":"openBusinessView:fail cancel"}
根据后端描述/日志,这种情况收到了微信返回确认支付分的回调消息!!?
请问,这个错误的具体场景是什么?如何复现?最重要的是,可能出现报此错误的情况下收到微信的「用户确认」回调吗?
wx.openBusinessView({
businessType: 'wxpayScoreUse',
extraData,
success: (res: any) => {
// res = { errMsg: "openBusinessView:ok",errCode:0, extraData: { appId:'',query_id:'' } }
const { query_id } = res.extraData || {}
if (query_id) { // 有query_id说明是授权成功
resolve(res)
return
}
uni.showToast({
title: '已取消',
icon: 'error',
duration: 2000,
})
reject(res)
},
fail: (err: any) => {
// 这里收到错误 {"errCode":-3,"errMsg":"openBusinessView:fail cancel"}
if (err.errMsg === 'openBusinessView:fail another navigation is in progress') {
uni.showModal({
title: '提示',
content: '正在授权中,请勿重复提交!',
showCancel: false,
success: () => {
const url = '/pages/index/index'
if ((uni as any).restartMiniProgram) {
(uni as any).restartMiniProgram({ path: url })
} else {
(uni as any).exitMiniProgram()
}
reject(err)
}
})
return
}
reject(err)
}
})
“有query_id说明是授权成功”,真6啊,判断支付分订单创建成功是以查询和通知为准的,你这依赖前端?