Files
x-server-mobile/frontend/src/router/index.tsx
T

36 lines
1.5 KiB
TypeScript
Raw Normal View History

import { createBrowserRouter, Navigate } from 'react-router-dom'
import MobileLayout from '@/components/layout/MobileLayout'
import Dashboard from '@/pages/dashboard'
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'
import Login from '@/pages/login'
import SimpleLogin from '@/pages/login-simple'
const router = createBrowserRouter([
{
path: '/',
element: <MobileLayout />,
children: [
{ index: true, element: <Navigate to='/dashboard' replace /> },
{ path: 'dashboard', element: <Dashboard /> },
{ 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 /> },
{ path: 'business-trip/:id', element: <BusinessTripDetail /> },
2026-02-25 23:54:38 +08:00
{ path: 'approval', element: <ApprovalList /> },
{ path: 'approval/:id', element: <ApprovalDetail /> },
],
},
{ path: '/login', element: <Login /> },
{ path: '/login-simple', element: <SimpleLogin /> },
{ path: '*', element: <Navigate to='/dashboard' replace /> },
])
export default router