fix: 无 token 不显示余额;充值完成后立即预取最新余额

- UserInfo.balance 改为可选字段
- 无 token 时不设 balance,PaymentForm 不渲染余额行
- COMPLETED 触发时立即调 loadUserAndOrders 刷新余额
  2.2s 结果页展示期间余额已在后台拉取,回表单时即刻呈现新值
This commit is contained in:
erio
2026-03-01 21:24:11 +08:00
parent 81b4573edd
commit 0c2476f340
3 changed files with 7 additions and 6 deletions

View File

@@ -72,7 +72,7 @@ function OrdersContent() {
return;
}
if (!hasToken) {
setUserInfo({ id: userId, username: `用户 #${userId}`, balance: 0 });
setUserInfo({ id: userId, username: `用户 #${userId}` });
setOrders([]);
setError('当前链接未携带登录 token无法查询"我的订单"。');
return;