|
|
|
@ -23,12 +23,28 @@ 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: 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 /> },
|
|
|
|
|
]
|
|
|
|
|
: [
|
|
|
|
|
{
|
|
|
|
|
element: <DesktopApp />,
|
|
|
|
|
children: [
|
|
|
|
@ -39,16 +55,7 @@ const router = createBrowserRouter([
|
|
|
|
|
{ path: 'order/chat/:order_sn', element: <Conversations /> },
|
|
|
|
|
{ path: 'order/chat', element: <Conversations /> },
|
|
|
|
|
{ path: 'account/profile', element: <AccountProfile /> },
|
|
|
|
|
]
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: 'm',
|
|
|
|
|
element: <MobileApp />,
|
|
|
|
|
children: [
|
|
|
|
|
{ path: 'conversation', element: <MobileConversation /> },
|
|
|
|
|
{ path: 'chat/:order_sn', element: <MobileChat /> },
|
|
|
|
|
{ path: 'chat', element: <MobileChat /> },
|
|
|
|
|
]
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
@ -62,7 +69,7 @@ const router = createBrowserRouter([
|
|
|
|
|
{ path: 'mobile-login', element: <MobileLogin /> },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
])
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
ReactDOM.createRoot(document.getElementById('root')).render(
|
|
|
|
|
// <React.StrictMode>
|
|
|
|
|