import { createBrowserRouter, Navigate } from 'react-router-dom' import MobileLayout from '@/components/layout/MobileLayout' import Dashboard from '@/pages/dashboard' import Profile from '@/pages/profile' import Settings from '@/pages/settings' import ChangePassword from '@/pages/change-password' import BusinessTripList from '@/pages/business-trip/list' import BusinessTripApply from '@/pages/business-trip/apply' import BusinessTripDetail from '@/pages/business-trip/detail' import SelectApprover from '@/pages/business-trip/select-approver' import SelectCc from '@/pages/business-trip/select-cc' import ApprovalList from '@/pages/approval/list' import ApprovalDetail from '@/pages/approval/detail' import QuickAction from '@/pages/approval/quick-action' import RejectPage from '@/pages/approval/reject' import Login from '@/pages/login' import SimpleLogin from '@/pages/login-simple' import DebugFeishu from '@/pages/debug-feishu' import FeishuEnvTest from '@/pages/feishu-env-test' const router = createBrowserRouter([ { path: '/', element: , children: [ { index: true, element: }, { path: 'dashboard', element: }, { path: 'profile', element: }, { path: 'settings', element: }, { path: 'change-password', element: }, { path: 'business-trip', element: }, { path: 'business-trip/apply', element: }, { path: 'business-trip/apply/select-approver', element: }, { path: 'business-trip/apply/select-cc', element: }, { path: 'business-trip/detail/:id', element: }, { path: 'business-trip/:id', element: }, { path: 'approval', element: }, { path: 'approval/:id', element: }, ], }, // 详情页移到顶层,支持未登录访问(页面自己处理登录检查) { path: '/approval/detail/:id', element: }, { path: '/business-trip/detail/:id', element: }, { path: '/login', element: }, { path: '/login-simple', element: }, { path: '/debug-feishu', element: }, { path: '/feishu-env-test', element: }, { path: '/approval/quick-action', element: }, { path: '/approval/reject', element: }, { path: '*', element: }, ]) export default router