import React, { lazy, Suspense } from 'react'; import { Route, Routes, useLocation } from 'react-router-dom'; import Loading from './components/common/Loading.js'; import User from './pages/User'; import { AuthRedirect, PrivateRoute } from './helpers'; import RegisterForm from './components/auth/RegisterForm.js'; import LoginForm from './components/auth/LoginForm.js'; import NotFound from './pages/NotFound'; import Setting from './pages/Setting'; import EditUser from './pages/User/EditUser'; import PasswordResetForm from './components/auth/PasswordResetForm.js'; import PasswordResetConfirm from './components/auth/PasswordResetConfirm.js'; 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 Midjourney from './pages/Midjourney'; import Pricing from './pages/Pricing/index.js'; import Task from './pages/Task/index.js'; import Playground from './pages/Playground/index.js'; import OAuth2Callback from './components/auth/OAuth2Callback.js'; import PersonalSetting from './components/settings/PersonalSetting.js'; import Setup from './pages/Setup/index.js'; import SetupCheck from './components/layout/SetupCheck.js'; 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;