修复支付系统核心问题v2\n\n- poller_online.php: 添加全局异常捕获,防止500错误\n- pay.php: queryOrder返回created_at,syncPoller action占位\n- player.php: 续支付检测添加5分钟过期检查\n- 解决:\n 1. Java轮询500错误\n 2. 订单超时5分钟\n 3. 前端过期订单自动清除\n 4. 支付成功后按钮锁定

This commit is contained in:
ypsdf1
2026-07-15 19:48:08 +08:00
parent 1cd8415516
commit cb949f5b16
3 changed files with 32 additions and 6 deletions
+12
View File
@@ -1113,6 +1113,17 @@ if ($currentVersion !== $BUILD_VERSION) {
btn.textContent = '✅ 支付完成';
btn.onclick = null;
} else if (res.data.status === 'created') {
// 检查订单是否已过期(5分钟)
const nowSec = Math.floor(Date.now() / 1000);
const createdAt = res.data.created_at || 0;
if (createdAt && (nowSec - createdAt) > 300) {
// 已过期:清除本地记录,重置按钮
localStorage.removeItem('sdf1_last_recharge_no');
st.innerHTML = '<span style="color:var(--yellow)">订单已过期(超过5分钟),请重新下单。</span>';
btn.disabled = false;
btn.textContent = '🅰️ 支付宝支付 ¥0.01';
btn.onclick = startRecharge;
} else {
// 未支付:显示继续支付
btn.textContent = '🔄 继续支付 ¥' + (res.data.money || '0.01');
btn.onclick = async function() {
@@ -1140,6 +1151,7 @@ if ($currentVersion !== $BUILD_VERSION) {
};
st.innerHTML = '<span style="color:var(--yellow)">⚠️ 您有一笔未完成的订单,<a href="javascript:void(0)" onclick="document.getElementById(\'rechargeBtn\').click()" style="color:var(--accent)">点此继续支付</a></span>';
document.getElementById('rechargeQueryBtn').style.display = 'block';
}
}
// 如果是 expired 或其他状态,不处理,保持默认按钮
}