feat(mp): App 级告警长轮询 + 健康总览 TS 修复
- 新增 useAlertPolling hook:10s 间隔轮询 critical 告警 - requestUnlimited 独立通道,不占并发槽位 - generation counter 防重叠 + 失败指数退避(max 30s/10次) - 新告警弹窗 Taro.showModal + TabBar 角标 - 修复 HealthThreshold 属性名(indicator/level 非 indicator_name/severity) - 修复 usePageData fetchData 返回类型
This commit is contained in:
@@ -5,6 +5,7 @@ import ErrorBoundary from './components/ErrorBoundary';
|
||||
import { flushEvents } from './services/analytics';
|
||||
import { useAuthStore } from './stores/auth';
|
||||
import { useUIStore } from './stores/ui';
|
||||
import { useAlertPolling } from './hooks/useAlertPolling';
|
||||
import { migrateLegacyStorage } from './utils/secure-storage';
|
||||
import './app.scss';
|
||||
|
||||
@@ -19,6 +20,9 @@ function App({ children }: PropsWithChildren<Record<string, unknown>>) {
|
||||
restoreUI();
|
||||
});
|
||||
|
||||
// 告警轮询:登录态下自动监听 critical 告警
|
||||
useAlertPolling();
|
||||
|
||||
// 暴露全局 bridge 供 MCP/自动化测试调用(仅 dev 模式)
|
||||
useEffect(() => {
|
||||
if (process.env.NODE_ENV === 'production') return;
|
||||
|
||||
Reference in New Issue
Block a user