feat: 集成错误处理与网络状态管理
- 在 Providers 组件中引入 ErrorProvider 以处理全局错误状态 - 更新 PlayerAppShell 组件的注释,说明网络状态横幅的用途 - 在 lotteryHttp 中添加对 500、502、503 错误的处理,更新全局错误状态 - 导出 useNetworkStatus 和 useIsOffline 钩子以支持网络状态管理
This commit is contained in:
@@ -12,10 +12,14 @@ type PlayerAppShellProps = {
|
||||
/**
|
||||
* 玩家端外壳:顶栏(品牌 + 会话)+ 主体 + **底部 Tab 导航**(H5)。
|
||||
* 底部栏留白:{@link PlayerBottomNav} 对应 `padding-bottom`.
|
||||
*
|
||||
* 注意:全局离线横幅和服务器错误覆盖层已在 ErrorProvider 中处理
|
||||
* 这里的 NetworkStatusBanner 仅用于 WebSocket 状态显示
|
||||
*/
|
||||
export function PlayerAppShell({ children }: PlayerAppShellProps): ReactNode {
|
||||
return (
|
||||
<div className="flex min-h-dvh flex-col bg-background text-foreground">
|
||||
{/* WebSocket 连接状态横幅(降级模式提示) */}
|
||||
<NetworkStatusBanner />
|
||||
<header className="sticky top-0 z-40 shrink-0 border-b border-border bg-background/95 backdrop-blur-sm supports-[backdrop-filter]:bg-background/80">
|
||||
<div className="mx-auto flex h-12 max-w-lg items-center gap-2 px-4">
|
||||
|
||||
Reference in New Issue
Block a user