From 36275eb307c9dc42606b75fe8b9745b771886829 Mon Sep 17 00:00:00 2001 From: iven Date: Wed, 6 May 2026 10:34:55 +0800 Subject: [PATCH] =?UTF-8?q?fix(web):=20=E5=86=BB=E7=BB=93=E6=8E=A8?= =?UTF-8?q?=E8=BF=9F=E6=A8=A1=E5=9D=97=E8=B7=AF=E7=94=B1=E5=AE=88=E5=8D=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web/src/App.tsx | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/apps/web/src/App.tsx b/apps/web/src/App.tsx index 715a4f3..2ad653e 100644 --- a/apps/web/src/App.tsx +++ b/apps/web/src/App.tsx @@ -1,6 +1,6 @@ import { useEffect, lazy, Suspense, useMemo } from 'react'; import { HashRouter, Routes, Route, Navigate } from 'react-router-dom'; -import { ConfigProvider, theme as antdTheme, Spin } from 'antd'; +import { ConfigProvider, theme as antdTheme, Spin, Result } from 'antd'; import zhCN from 'antd/locale/zh_CN'; import MainLayout from './layouts/MainLayout'; import Login from './pages/Login'; @@ -71,6 +71,19 @@ const ArticleEditor = lazy(() => import('./pages/health/ArticleEditor')); const ArticleCategoryManage = lazy(() => import('./pages/health/ArticleCategoryManage')); const ArticleTagManage = lazy(() => import('./pages/health/ArticleTagManage')); +const FROZEN_ROUTES = [ + '/health/care-plans', + '/health/shifts', + '/health/family-proxy', + '/health/medications', + '/health/dialysis', + '/health/schedules', +]; + +function FrozenRoute() { + return ; +} + function PrivateRoute({ children }: { children: React.ReactNode }) { const isAuthenticated = useAuthStore((s) => s.isAuthenticated); const permissions = useAuthStore((s) => s.permissions); @@ -91,6 +104,11 @@ function PrivateRoute({ children }: { children: React.ReactNode }) { if (!hasAccess) return ; } + // 冻结路由检查 + if (FROZEN_ROUTES.some((frozen) => path.startsWith(frozen))) { + return ; + } + return <>{children}; }