import React, { lazy, Suspense, useContext, useEffect } from 'react'; import { Route, Routes, useLocation } from 'react-router-dom'; import Loading from './components/Loading'; import User from './pages/User'; import { PrivateRoute } from './components/PrivateRoute'; import RegisterForm from './components/RegisterForm'; import LoginForm from './components/LoginForm'; import NotFound from './pages/NotFound'; import Setting from './pages/Setting'; import EditUser from './pages/User/EditUser'; import PasswordResetForm from './components/PasswordResetForm'; import PasswordResetConfirm from './components/PasswordResetConfirm'; import Channel from './pages/Channel'; import Token from './pages/Token'; import EditChannel from './pages/Channel/EditChannel'; import Redemption from './pages/Redemption'; import TopUp from './pages/TopUp'; import Log from './pages/Log'; import Chat from './pages/Chat'; import Chat2Link from './pages/Chat2Link'; import { Layout } from '@douyinfe/semi-ui'; import Midjourney from './pages/Midjourney'; import Pricing from './pages/Pricing/index.js'; import Task from './pages/Task/index.js'; import Playground from './pages/Playground/Playground.js'; import OAuth2Callback from './components/OAuth2Callback.js'; import PersonalSetting from './components/PersonalSetting.js'; import Setup from './pages/Setup/index.js'; import SetupCheck from './components/SetupCheck'; import AuthRedirect from './components/AuthRedirect'; const Home = lazy(() => import('./pages/Home')); const Detail = lazy(() => import('./pages/Detail')); const About = lazy(() => import('./pages/About')); function App() { const location = useLocation(); return ( } key={location.pathname}> } /> } key={location.pathname}> } /> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } /> } /> } /> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> }> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> {/* 方便使用chat2link直接跳转聊天... */} } key={location.pathname}> } /> } /> ); } export default App;