|
|
|
@ -23,34 +23,41 @@ import '@/assets/index.css'
|
|
|
|
|
|
|
|
|
|
useAuthStore.getState().loadUserSession()
|
|
|
|
|
|
|
|
|
|
const isMobileApp = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) !== null;
|
|
|
|
|
|
|
|
|
|
const router = createBrowserRouter([
|
|
|
|
|
{
|
|
|
|
|
path: '/',
|
|
|
|
|
element: <AuthApp />,
|
|
|
|
|
errorElement: <ErrorPage />,
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
element: <DesktopApp />,
|
|
|
|
|
children: [
|
|
|
|
|
{ index: true, element: <OrderFollow /> },
|
|
|
|
|
{ path: 'order/follow', element: <OrderFollow /> },
|
|
|
|
|
{ path: 'chat/history', element: <ChatHistory /> },
|
|
|
|
|
{ path: 'sales/management', element: <SalesManagement /> },
|
|
|
|
|
{ path: 'order/chat/:order_sn', element: <Conversations /> },
|
|
|
|
|
{ path: 'order/chat', element: <Conversations /> },
|
|
|
|
|
{ path: 'account/profile', element: <AccountProfile /> },
|
|
|
|
|
children: isMobileApp
|
|
|
|
|
? [
|
|
|
|
|
{
|
|
|
|
|
path: 'm',
|
|
|
|
|
element: <MobileApp />,
|
|
|
|
|
children: [
|
|
|
|
|
{ path: 'conversation', element: <MobileConversation /> },
|
|
|
|
|
// { path: 'chat/:order_sn', element: <MobileChat /> },
|
|
|
|
|
// { path: 'chat', element: <MobileChat /> },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{ path: 'm/chat/:order_sn', element: <MobileChat /> },
|
|
|
|
|
{ path: 'm/chat', element: <MobileChat /> },
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'm',
|
|
|
|
|
element: <MobileApp />,
|
|
|
|
|
children: [
|
|
|
|
|
{ path: 'conversation', element: <MobileConversation /> },
|
|
|
|
|
{ path: 'chat/:order_sn', element: <MobileChat /> },
|
|
|
|
|
{ path: 'chat', element: <MobileChat /> },
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
: [
|
|
|
|
|
{
|
|
|
|
|
element: <DesktopApp />,
|
|
|
|
|
children: [
|
|
|
|
|
{ index: true, element: <OrderFollow /> },
|
|
|
|
|
{ path: 'order/follow', element: <OrderFollow /> },
|
|
|
|
|
{ path: 'chat/history', element: <ChatHistory /> },
|
|
|
|
|
{ path: 'sales/management', element: <SalesManagement /> },
|
|
|
|
|
{ path: 'order/chat/:order_sn', element: <Conversations /> },
|
|
|
|
|
{ path: 'order/chat', element: <Conversations /> },
|
|
|
|
|
{ path: 'account/profile', element: <AccountProfile /> },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/p',
|
|
|
|
@ -59,10 +66,10 @@ const router = createBrowserRouter([
|
|
|
|
|
{ path: 'dingding/qrcode', element: <DingdingQRCode /> },
|
|
|
|
|
{ path: 'dingding/callback', element: <DingdingCallback /> },
|
|
|
|
|
{ path: 'dingding/logout', element: <DingdingLogout /> },
|
|
|
|
|
{ path: 'mobile-login', element: <MobileLogin />},
|
|
|
|
|
{ path: 'mobile-login', element: <MobileLogin /> },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
|
|
// <React.StrictMode>
|
|
|
|
|