2025-10-30 11:14:43 +08:00
|
|
|
import { BrowserRouter, Routes, Route, Navigate } from 'react-router-dom';
|
|
|
|
|
import { ConfigProvider } from 'antd';
|
|
|
|
|
import zhCN from 'antd/locale/zh_CN';
|
|
|
|
|
import ProjectList from './pages/ProjectList';
|
|
|
|
|
import ProjectWizardNew from './pages/ProjectWizardNew';
|
|
|
|
|
import ProjectDetail from './pages/ProjectDetail';
|
|
|
|
|
import WorldSetting from './pages/WorldSetting';
|
|
|
|
|
import Outline from './pages/Outline';
|
|
|
|
|
import Characters from './pages/Characters';
|
|
|
|
|
import Relationships from './pages/Relationships';
|
|
|
|
|
import Organizations from './pages/Organizations';
|
|
|
|
|
import Chapters from './pages/Chapters';
|
2025-10-31 17:23:25 +08:00
|
|
|
import WritingStyles from './pages/WritingStyles';
|
2025-10-30 16:53:50 +08:00
|
|
|
import Settings from './pages/Settings';
|
2025-10-30 11:14:43 +08:00
|
|
|
// import Polish from './pages/Polish';
|
|
|
|
|
import Login from './pages/Login';
|
|
|
|
|
import AuthCallback from './pages/AuthCallback';
|
|
|
|
|
import ProtectedRoute from './components/ProtectedRoute';
|
|
|
|
|
import './App.css';
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
|
return (
|
|
|
|
|
<ConfigProvider locale={zhCN}>
|
|
|
|
|
<BrowserRouter
|
|
|
|
|
future={{
|
|
|
|
|
v7_startTransition: true,
|
|
|
|
|
v7_relativeSplatPath: true,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Routes>
|
|
|
|
|
<Route path="/login" element={<Login />} />
|
|
|
|
|
<Route path="/auth/callback" element={<AuthCallback />} />
|
|
|
|
|
|
|
|
|
|
<Route path="/" element={<ProtectedRoute><ProjectList /></ProtectedRoute>} />
|
|
|
|
|
<Route path="/wizard" element={<ProtectedRoute><ProjectWizardNew /></ProtectedRoute>} />
|
2025-10-30 16:53:50 +08:00
|
|
|
<Route path="/settings" element={<ProtectedRoute><Settings /></ProtectedRoute>} />
|
2025-10-30 11:14:43 +08:00
|
|
|
<Route path="/project/:projectId" element={<ProtectedRoute><ProjectDetail /></ProtectedRoute>}>
|
|
|
|
|
<Route index element={<Navigate to="world-setting" replace />} />
|
|
|
|
|
<Route path="world-setting" element={<WorldSetting />} />
|
|
|
|
|
<Route path="outline" element={<Outline />} />
|
|
|
|
|
<Route path="characters" element={<Characters />} />
|
|
|
|
|
<Route path="relationships" element={<Relationships />} />
|
|
|
|
|
<Route path="organizations" element={<Organizations />} />
|
|
|
|
|
<Route path="chapters" element={<Chapters />} />
|
2025-10-31 17:23:25 +08:00
|
|
|
<Route path="writing-styles" element={<WritingStyles />} />
|
2025-10-30 11:14:43 +08:00
|
|
|
{/* <Route path="polish" element={<Polish />} /> */}
|
|
|
|
|
</Route>
|
|
|
|
|
</Routes>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
</ConfigProvider>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default App;
|