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

View File

@@ -61,8 +61,8 @@ const HeaderBar = () => {
}, },
{ {
text: t('控制台'), text: t('控制台'),
itemKey: 'detail', itemKey: 'console',
to: '/detail', to: '/console',
}, },
{ {
text: t('定价'), 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.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 <Dropdown.Item
onClick={() => { onClick={() => {
navigate('/personal'); navigate('/console/personal');
setMobileMenuOpen(false); 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" 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>
<Dropdown.Item <Dropdown.Item
onClick={() => { onClick={() => {
navigate('/token'); navigate('/console/token');
setMobileMenuOpen(false); 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" 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>
<Dropdown.Item <Dropdown.Item
onClick={() => { onClick={() => {
navigate('/topup'); navigate('/console/topup');
setMobileMenuOpen(false); 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" 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 // Define routerMap as a constant outside the component
const routerMap = { const routerMap = {
home: '/', home: '/',
channel: '/channel', channel: '/console/channel',
token: '/token', token: '/console/token',
redemption: '/redemption', redemption: '/console/redemption',
topup: '/topup', topup: '/console/topup',
user: '/user', user: '/console/user',
log: '/log', log: '/console/log',
midjourney: '/midjourney', midjourney: '/console/midjourney',
setting: '/setting', setting: '/console/setting',
about: '/about', about: '/about',
detail: '/detail', detail: '/console',
pricing: '/pricing', pricing: '/pricing',
task: '/task', task: '/console/task',
playground: '/playground', playground: '/console/playground',
personal: '/personal', personal: '/console/personal',
}; };
const SiderBar = () => { const SiderBar = () => {