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:
iven
2026-05-22 12:06:02 +08:00
parent d24aefe750
commit 0dfbe3130c
4 changed files with 131 additions and 5 deletions

View File

@@ -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;