新增管理帖子的组件
Change-Id: I7299ad6f735064dd112f92bab7c87daa952e6dc2
diff --git a/WZY/xhs_front/src/router/index.jsx b/WZY/xhs_front/src/router/index.jsx
index 077f8ed..fd959b9 100644
--- a/WZY/xhs_front/src/router/index.jsx
+++ b/WZY/xhs_front/src/router/index.jsx
@@ -1,33 +1,30 @@
// src/router/index.jsx
+
import React from 'react'
import { Routes, Route, Navigate } from 'react-router-dom'
-
-// 确认这些路径和文件名与你项目里是一一对应的
-import CreatePost from '../components/CreatePost' // src/components/CreatePost.jsx
-import HomeFeed from '../components/HomeFeed' // src/components/HomeFeed.jsx
-import PlaceholderPage from '../components/PlaceholderPage'// src/components/PlaceholderPage.jsx
-import UploadPage from '../components/UploadPage' // src/components/UploadPage.jsx
+import CreatePost from '../components/CreatePost'
+import HomeFeed from '../components/HomeFeed'
+import NotebookPage from '../components/NotebookPage'
+import UploadPage from '../components/UploadPage'
+import PlaceholderPage from '../components/PlaceholderPage'
export default function AppRouter() {
return (
<Routes>
- {/* 一定要放在最前面,防止被 /* 等 catch-all 覆盖 */}
- <Route path="/posts/new" element={<CreatePost />} />
+ {/* 新帖 & 编辑帖(/:postId 可选) */}
+ <Route path="/posts/new" element={<CreatePost />} />
+ <Route path="/posts/edit/:postId" element={<CreatePost />} />
<Route path="/home" element={<HomeFeed />} />
+ <Route path="/notebooks" element={<NotebookPage />} />
+ <Route path="/activity" element={<PlaceholderPage pageId="activity" />} />
+ <Route path="/notes" element={<PlaceholderPage pageId="notes" />} />
+ <Route path="/creator" element={<PlaceholderPage pageId="creator" />} />
+ <Route path="/journal" element={<PlaceholderPage pageId="journal" />} />
- <Route path="/notebooks" element={<PlaceholderPage pageId="notebooks" />} />
- <Route path="/activity" element={<PlaceholderPage pageId="activity" />} />
- <Route path="/notes" element={<PlaceholderPage pageId="notes" />} />
- <Route path="/creator" element={<PlaceholderPage pageId="creator" />} />
- <Route path="/journal" element={<PlaceholderPage pageId="journal" />} />
+ <Route path="/dashboard/*" element={<PlaceholderPage />} />
- <Route path="/dashboard/*" element={<UploadPage />} />
-
- {/* 根路径重定向到 dashboard */}
<Route path="/" element={<Navigate to="/dashboard/overview" replace />} />
-
- {/* 最后一个兜底 */}
<Route path="*" element={<PlaceholderPage pageId="home" />} />
</Routes>
)