更新加项支付结果判断
This commit is contained in:
@@ -438,9 +438,11 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
|
||||
|
||||
if (res.Status === 200) {
|
||||
const result = res.Data;
|
||||
// 假设支付成功返回 "success" 或 "1",失败返回其他值
|
||||
if (result === 'success' || result === '1' || result === 'SUCCESS') {
|
||||
// 支付成功
|
||||
console.log(result);
|
||||
|
||||
// 支付成功:返回 "true"
|
||||
if (result === 'true') {
|
||||
// 支付成功,停止轮询
|
||||
if (pollingTimerRef.current) {
|
||||
clearInterval(pollingTimerRef.current);
|
||||
pollingTimerRef.current = null;
|
||||
@@ -461,8 +463,8 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
|
||||
setPaymentMessage(null);
|
||||
}, 3000);
|
||||
});
|
||||
} else if (result === 'failed' || result === '0' || result === 'FAILED') {
|
||||
// 支付失败
|
||||
} else if (result === 'false') {
|
||||
// 支付失败,停止轮询
|
||||
if (pollingTimerRef.current) {
|
||||
clearInterval(pollingTimerRef.current);
|
||||
pollingTimerRef.current = null;
|
||||
@@ -472,7 +474,7 @@ export const ExamAddonPanel = ({ client }: ExamAddonPanelProps) => {
|
||||
setPaymentMessage(null);
|
||||
}, 3000);
|
||||
}
|
||||
// 其他状态继续轮询
|
||||
// 其他状态(如 "pending"、"processing" 等)继续轮询
|
||||
}
|
||||
} catch (err) {
|
||||
console.error('查询支付状态失败', err);
|
||||
|
||||
Reference in New Issue
Block a user