diff --git a/web-fe/.umirc.ts b/web-fe/.umirc.ts
index c384113..3805e34 100644
--- a/web-fe/.umirc.ts
+++ b/web-fe/.umirc.ts
@@ -26,6 +26,14 @@ export default defineConfig({
path: '/profile',
component: '@/pages/profile',
},
+ {
+ path: '/userList',
+ component: '@/pages/userList',
+ },
+ {
+ path:"/terminal",
+ component: '@/pages/terminal',
+ }
],
},
],
diff --git a/web-fe/src/components/Guide/Layout/index.tsx b/web-fe/src/components/Guide/Layout/index.tsx
index cc509f3..e0a7332 100644
--- a/web-fe/src/components/Guide/Layout/index.tsx
+++ b/web-fe/src/components/Guide/Layout/index.tsx
@@ -83,6 +83,12 @@ const MainLayout: React.FC = () => {
}>
镜像列表
+ }>
+ 用户
+
+ }>
+ 终端
+
}>
我的
diff --git a/web-fe/src/pages/components/Layout/index.tsx b/web-fe/src/pages/components/Layout/index.tsx
index 47ab20b..aa6964b 100644
--- a/web-fe/src/pages/components/Layout/index.tsx
+++ b/web-fe/src/pages/components/Layout/index.tsx
@@ -1,117 +1,125 @@
-import React, { useState, useEffect } from 'react';
-import { Layout, Menu, Button, Avatar, Dropdown, message } from 'antd';
import {
- AppstoreOutlined,
- UserOutlined,
- LogoutOutlined,
- MenuFoldOutlined,
- MenuUnfoldOutlined,
+ AppstoreOutlined,
+ LogoutOutlined,
+ MenuFoldOutlined,
+ MenuUnfoldOutlined,
+ UserOutlined,
} from '@ant-design/icons';
-import { history, useLocation, Outlet } from 'umi';
+import { Avatar, Button, Dropdown, Layout, Menu, message } from 'antd';
+import React, { useEffect, useState } from 'react';
+import { history, Outlet, useLocation } from 'umi';
import './index.less';
const { Header, Sider, Content } = Layout;
const MainLayout: React.FC = () => {
- const [collapsed, setCollapsed] = useState(false);
- const [username, setUsername] = useState('');
- const location = useLocation();
+ const [collapsed, setCollapsed] = useState(false);
+ const [username, setUsername] = useState('');
+ const location = useLocation();
- useEffect(() => {
- // 检查登录状态
- const isLoggedIn = localStorage.getItem('isLoggedIn');
- const currentUsername = localStorage.getItem('username');
+ useEffect(() => {
+ // 检查登录状态
+ const isLoggedIn = localStorage.getItem('isLoggedIn');
+ const currentUsername = localStorage.getItem('username');
- if (!isLoggedIn) {
- message.error('请先登录!');
- history.push('/login');
- return;
- }
+ if (!isLoggedIn) {
+ message.error('请先登录!');
+ history.push('/login');
+ return;
+ }
- setUsername(currentUsername || '');
- }, []);
+ setUsername(currentUsername || '');
+ }, []);
- const handleMenuClick = (key: string) => {
- // 使用路由导航
- history.push(`/${key}`);
- };
+ const handleMenuClick = (key: string) => {
+ // 使用路由导航
+ history.push(`/${key}`);
+ };
- const handleLogout = () => {
- localStorage.removeItem('isLoggedIn');
- localStorage.removeItem('username');
- message.success('已退出登录');
- history.push('/login');
- };
+ const handleLogout = () => {
+ localStorage.removeItem('isLoggedIn');
+ localStorage.removeItem('username');
+ message.success('已退出登录');
+ history.push('/login');
+ };
- const userMenu = (
-