新增访客聊天Widget组件、Admin端布局框架及路由
This commit is contained in:
@@ -3,12 +3,18 @@ import { Navigate, createBrowserRouter } from 'react-router-dom'
|
||||
import { Spin } from 'antd'
|
||||
|
||||
const AgentLayout = lazy(() => import('@/components/layout/AgentLayout'))
|
||||
const AdminLayout = lazy(() => import('@/components/layout/AdminLayout'))
|
||||
const Dashboard = lazy(() => import('@/pages/agent/Dashboard'))
|
||||
const ChatHistory = lazy(() => import('@/pages/agent/ChatHistory'))
|
||||
const Customers = lazy(() => import('@/pages/agent/Customers'))
|
||||
const Knowledge = lazy(() => import('@/pages/agent/Knowledge'))
|
||||
const Statistics = lazy(() => import('@/pages/agent/Statistics'))
|
||||
const Settings = lazy(() => import('@/pages/agent/Settings'))
|
||||
const AdminDashboard = lazy(() => import('@/pages/admin/Dashboard'))
|
||||
const Tenants = lazy(() => import('@/pages/admin/Tenants'))
|
||||
const Plans = lazy(() => import('@/pages/admin/Plans'))
|
||||
const Ops = lazy(() => import('@/pages/admin/Ops'))
|
||||
const WidgetPreview = lazy(() => import('@/pages/WidgetPreview'))
|
||||
|
||||
const loading = (
|
||||
<div className="h-full flex items-center justify-center">
|
||||
@@ -21,9 +27,20 @@ function Lazy({ children }: { children: React.ReactNode }) {
|
||||
}
|
||||
|
||||
export const router = createBrowserRouter([
|
||||
{
|
||||
path: '/widget/preview',
|
||||
element: <Lazy><WidgetPreview /></Lazy>,
|
||||
},
|
||||
{
|
||||
path: '/admin',
|
||||
element: <div>管理端</div>,
|
||||
element: <Lazy><AdminLayout /></Lazy>,
|
||||
children: [
|
||||
{ index: true, element: <Navigate to="/admin/dashboard" replace /> },
|
||||
{ path: 'dashboard', element: <Lazy><AdminDashboard /></Lazy> },
|
||||
{ path: 'tenants', element: <Lazy><Tenants /></Lazy> },
|
||||
{ path: 'plans', element: <Lazy><Plans /></Lazy> },
|
||||
{ path: 'ops', element: <Lazy><Ops /></Lazy> },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
|
||||
Reference in New Issue
Block a user