/* Copyright (c) 2025 Tethys Plex This file is part of Veloera. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ 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 TopUpSuccess from './pages/TopUp/TopUpSuccess'; 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 Inbox from './pages/Inbox'; import Message from './pages/Message'; import { AdminRoute } from './components/AdminRoute'; 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}> } /> } key={location.pathname}> } /> } key={location.pathname}> } /> {/* 方便使用chat2link直接跳转聊天... */} } key={location.pathname}> } /> {/* User inbox routes */} } key={location.pathname}> } /> } key={location.pathname}> } /> {/* Admin message management routes */} } key={location.pathname}> } /> } /> ); } export default App;