2026-02-24 17:57:25 +08:00
|
|
|
import { createBrowserRouter, Navigate } from 'react-router-dom'
|
|
|
|
|
import MobileLayout from '@/components/layout/MobileLayout'
|
|
|
|
|
import Dashboard from '@/pages/dashboard'
|
2026-02-26 15:19:37 +08:00
|
|
|
import Profile from '@/pages/profile'
|
|
|
|
|
import Settings from '@/pages/settings'
|
|
|
|
|
import ChangePassword from '@/pages/change-password'
|
2026-02-24 17:57:25 +08:00
|
|
|
import BusinessTripList from '@/pages/business-trip/list'
|
|
|
|
|
import BusinessTripApply from '@/pages/business-trip/apply'
|
|
|
|
|
import BusinessTripDetail from '@/pages/business-trip/detail'
|
2026-02-24 23:44:40 +08:00
|
|
|
import SelectApprover from '@/pages/business-trip/select-approver'
|
|
|
|
|
import SelectCc from '@/pages/business-trip/select-cc'
|
2026-02-25 23:54:38 +08:00
|
|
|
import ApprovalList from '@/pages/approval/list'
|
|
|
|
|
import ApprovalDetail from '@/pages/approval/detail'
|
2026-02-26 19:30:12 +08:00
|
|
|
import QuickAction from '@/pages/approval/quick-action'
|
2026-02-27 17:57:49 +08:00
|
|
|
import RejectPage from '@/pages/approval/reject'
|
2026-02-24 17:57:25 +08:00
|
|
|
import Login from '@/pages/login'
|
2026-02-25 18:09:04 +08:00
|
|
|
import SimpleLogin from '@/pages/login-simple'
|
2026-02-26 19:16:33 +08:00
|
|
|
import DebugFeishu from '@/pages/debug-feishu'
|
2026-02-28 08:58:51 +08:00
|
|
|
import FeishuEnvTest from '@/pages/feishu-env-test'
|
2026-02-24 17:57:25 +08:00
|
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
element: <MobileLayout />,
|
|
|
|
|
children: [
|
|
|
|
|
{ index: true, element: <Navigate to='/dashboard' replace /> },
|
|
|
|
|
{ path: 'dashboard', element: <Dashboard /> },
|
2026-02-26 15:19:37 +08:00
|
|
|
{ path: 'profile', element: <Profile /> },
|
|
|
|
|
{ path: 'settings', element: <Settings /> },
|
|
|
|
|
{ path: 'change-password', element: <ChangePassword /> },
|
2026-02-24 17:57:25 +08:00
|
|
|
{ path: 'business-trip', element: <BusinessTripList /> },
|
|
|
|
|
{ path: 'business-trip/apply', element: <BusinessTripApply /> },
|
2026-02-24 23:44:40 +08:00
|
|
|
{ path: 'business-trip/apply/select-approver', element: <SelectApprover /> },
|
|
|
|
|
{ path: 'business-trip/apply/select-cc', element: <SelectCc /> },
|
2026-02-27 17:57:49 +08:00
|
|
|
{ path: 'business-trip/detail/:id', element: <BusinessTripDetail /> },
|
2026-02-24 17:57:25 +08:00
|
|
|
{ path: 'business-trip/:id', element: <BusinessTripDetail /> },
|
2026-02-25 23:54:38 +08:00
|
|
|
{ path: 'approval', element: <ApprovalList /> },
|
|
|
|
|
{ path: 'approval/:id', element: <ApprovalDetail /> },
|
2026-02-24 17:57:25 +08:00
|
|
|
],
|
|
|
|
|
},
|
2026-02-27 17:57:49 +08:00
|
|
|
// 详情页移到顶层,支持未登录访问(页面自己处理登录检查)
|
|
|
|
|
{ path: '/approval/detail/:id', element: <ApprovalDetail /> },
|
|
|
|
|
{ path: '/business-trip/detail/:id', element: <BusinessTripDetail /> },
|
2026-02-24 17:57:25 +08:00
|
|
|
{ path: '/login', element: <Login /> },
|
2026-02-25 18:09:04 +08:00
|
|
|
{ path: '/login-simple', element: <SimpleLogin /> },
|
2026-02-26 19:16:33 +08:00
|
|
|
{ path: '/debug-feishu', element: <DebugFeishu /> },
|
2026-02-28 08:58:51 +08:00
|
|
|
{ path: '/feishu-env-test', element: <FeishuEnvTest /> },
|
2026-02-26 19:33:33 +08:00
|
|
|
{ path: '/approval/quick-action', element: <QuickAction /> },
|
2026-02-27 17:57:49 +08:00
|
|
|
{ path: '/approval/reject', element: <RejectPage /> },
|
2026-02-26 15:19:37 +08:00
|
|
|
{ path: '*', element: <Navigate to='/login' replace /> },
|
2026-02-24 17:57:25 +08:00
|
|
|
])
|
|
|
|
|
|
|
|
|
|
export default router
|