feat: Add the /console/* route

This commit is contained in:
Apple\Apple
2025-05-20 01:11:37 +08:00
parent 305d7528da
commit bcbb9bb16a
3 changed files with 33 additions and 33 deletions

View File

@@ -55,7 +55,7 @@ function App() {
}
/>
<Route
path='/channel'
path='/console/channel'
element={
<PrivateRoute>
<Channel />
@@ -63,7 +63,7 @@ function App() {
}
/>
<Route
path='/channel/edit/:id'
path='/console/channel/edit/:id'
element={
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
<EditChannel />
@@ -71,7 +71,7 @@ function App() {
}
/>
<Route
path='/channel/add'
path='/console/channel/add'
element={
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
<EditChannel />
@@ -79,7 +79,7 @@ function App() {
}
/>
<Route
path='/token'
path='/console/token'
element={
<PrivateRoute>
<Token />
@@ -87,7 +87,7 @@ function App() {
}
/>
<Route
path='/playground'
path='/console/playground'
element={
<PrivateRoute>
<Playground />
@@ -95,7 +95,7 @@ function App() {
}
/>
<Route
path='/redemption'
path='/console/redemption'
element={
<PrivateRoute>
<Redemption />
@@ -103,7 +103,7 @@ function App() {
}
/>
<Route
path='/user'
path='/console/user'
element={
<PrivateRoute>
<User />
@@ -111,7 +111,7 @@ function App() {
}
/>
<Route
path='/user/edit/:id'
path='/console/user/edit/:id'
element={
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
<EditUser />
@@ -119,7 +119,7 @@ function App() {
}
/>
<Route
path='/user/edit'
path='/console/user/edit'
element={
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
<EditUser />
@@ -183,7 +183,7 @@ function App() {
}
/>
<Route
path='/setting'
path='/console/setting'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
@@ -193,7 +193,7 @@ function App() {
}
/>
<Route
path='/personal'
path='/console/personal'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
@@ -203,7 +203,7 @@ function App() {
}
/>
<Route
path='/topup'
path='/console/topup'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
@@ -213,7 +213,7 @@ function App() {
}
/>
<Route
path='/log'
path='/console/log'
element={
<PrivateRoute>
<Log />
@@ -221,7 +221,7 @@ function App() {
}
/>
<Route
path='/detail'
path='/console'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
@@ -231,7 +231,7 @@ function App() {
}
/>
<Route
path='/midjourney'
path='/console/midjourney'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>
@@ -241,7 +241,7 @@ function App() {
}
/>
<Route
path='/task'
path='/console/task'
element={
<PrivateRoute>
<Suspense fallback={<Loading></Loading>} key={location.pathname}>

View File

@@ -61,8 +61,8 @@ const HeaderBar = () => {
},
{
text: t('控制台'),
itemKey: 'detail',
to: '/detail',
itemKey: 'console',
to: '/console',
},
{
text: t('定价'),
@@ -216,7 +216,7 @@ const HeaderBar = () => {
<Dropdown.Menu className="!bg-semi-color-bg-overlay !border-semi-color-border !shadow-lg !rounded-lg dark:!bg-gray-700 dark:!border-gray-600">
<Dropdown.Item
onClick={() => {
navigate('/personal');
navigate('/console/personal');
setMobileMenuOpen(false);
}}
className="!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
@@ -228,7 +228,7 @@ const HeaderBar = () => {
</Dropdown.Item>
<Dropdown.Item
onClick={() => {
navigate('/token');
navigate('/console/token');
setMobileMenuOpen(false);
}}
className="!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"
@@ -240,7 +240,7 @@ const HeaderBar = () => {
</Dropdown.Item>
<Dropdown.Item
onClick={() => {
navigate('/topup');
navigate('/console/topup');
setMobileMenuOpen(false);
}}
className="!px-3 !py-1.5 !text-sm !text-semi-color-text-0 hover:!bg-semi-color-fill-1 dark:!text-gray-200 dark:hover:!bg-blue-500 dark:hover:!text-white"

View File

@@ -77,20 +77,20 @@ const iconStyle = (itemKey, selectedKeys) => {
// Define routerMap as a constant outside the component
const routerMap = {
home: '/',
channel: '/channel',
token: '/token',
redemption: '/redemption',
topup: '/topup',
user: '/user',
log: '/log',
midjourney: '/midjourney',
setting: '/setting',
channel: '/console/channel',
token: '/console/token',
redemption: '/console/redemption',
topup: '/console/topup',
user: '/console/user',
log: '/console/log',
midjourney: '/console/midjourney',
setting: '/console/setting',
about: '/about',
detail: '/detail',
detail: '/console',
pricing: '/pricing',
task: '/task',
playground: '/playground',
personal: '/personal',
task: '/console/task',
playground: '/console/playground',
personal: '/console/personal',
};
const SiderBar = () => {