import { Routes, Route, Navigate } from 'react-router-dom'; import { AppLayout } from '@/components/Layout'; import { Dashboard, UserList, CallList } from '@/pages'; import { useAuth } from '@/store'; // 导入移动端组件 import MobileLayout from '@/components/MobileLayout'; import MobileHome from '@/pages/mobile/Home'; import MobileCall from '@/pages/mobile/Call'; import MobileDocuments from '@/pages/mobile/Documents'; import MobileSettings from '@/pages/mobile/Settings'; import MobileRecharge from '@/pages/mobile/Recharge'; import MobileAppointment from '@/pages/mobile/Appointment'; // 导入设备重定向组件 import DeviceRedirect from '@/components/DeviceRedirect'; // 导入视频通话测试组件 import VideoCallTest from '@/components/VideoCallTest'; // 导入视频通话页面 import { VideoCallPage } from '@/pages/VideoCall/VideoCallPage'; // 私有路由组件 const PrivateRoute = ({ children }: { children: React.ReactNode }) => { const { isAuthenticated } = useAuth(); return isAuthenticated ? <>{children} : ; }; // 公共路由组件 const PublicRoute = ({ children }: { children: React.ReactNode }) => { const { isAuthenticated } = useAuth(); return !isAuthenticated ? <>{children} : ; }; // 登录页面(临时占位符) const LoginPage = () => (
登录页面 - 待实现
); // 404页面 const NotFoundPage = () => (

404

页面不存在

); const AppRoutes = () => { return ( {/* 公共路由 */} } /> {/* 视频通话测试路由 - 独立访问 */} } /> {/* 根路径 - 智能重定向 */} } /> {/* 移动端路由 */} } /> } /> } /> } /> } /> } /> } /> } /> } /> } /> {/* 私有路由 - Web管理后台 */} {/* 仪表板 */} } /> {/* 用户管理 */} } /> {/* 通话记录 */} } /> {/* 视频通话测试 */} } /> {/* 文档管理 - 待实现 */} 文档管理页面 - 待实现 } /> {/* 预约管理 - 待实现 */} 预约管理页面 - 待实现 } /> {/* 译员管理 - 待实现 */} 译员管理页面 - 待实现 } /> {/* 财务管理 - 待实现 */} 财务管理页面 - 待实现 } /> {/* 系统设置 - 待实现 */} 系统设置页面 - 待实现 } /> {/* 404页面 */} } /> } /> ); }; export default AppRoutes;