diff --git a/apps/web/src/app/main/layout/UserMenu.tsx b/apps/web/src/app/main/layout/UserMenu.tsx index 97396fd..2591253 100644 --- a/apps/web/src/app/main/layout/UserMenu.tsx +++ b/apps/web/src/app/main/layout/UserMenu.tsx @@ -1,49 +1,70 @@ -import { Avatar, Menu, Dropdown } from 'antd'; -import { LogoutOutlined, SettingOutlined } from '@ant-design/icons'; -import { useAuth } from '@web/src/providers/auth-provider'; -import { useNavigate } from 'react-router-dom'; +import { Avatar, Menu, Dropdown } from "antd"; +import { + LogoutOutlined, + SettingOutlined, + UserAddOutlined, + UserSwitchOutlined, +} from "@ant-design/icons"; +import { useAuth } from "@web/src/providers/auth-provider"; +import { useNavigate } from "react-router-dom"; export const UserMenu = () => { - const { isAuthenticated, logout, user } = useAuth(); - const navigate = useNavigate(); + const { isAuthenticated, logout, user } = useAuth(); + const navigate = useNavigate(); - return ( - - {isAuthenticated ? ( - <> - -
- - {(user?.showname || user?.username || '')[0]?.toUpperCase()} - -
- {user?.showname || user?.username} - {user?.department?.name || user?.officerId} -
-
-
- - } className="px-4"> - 个人设置 - - } - onClick={async () => await logout()} - className="px-4 text-red-500 hover:text-red-600 hover:bg-red-50" - > - 退出登录 - - - ) : ( - navigate("/login")} - className="px-4 text-blue-500 hover:text-blue-600 hover:bg-blue-50" - > - 登录/注册 - - )} -
- ); -}; \ No newline at end of file + return ( + + {isAuthenticated ? ( + <> + +
+ + {(user?.showname || + user?.username || + "")[0]?.toUpperCase()} + +
+ + {user?.showname || user?.username} + + + {user?.department?.name || user?.officerId} + +
+
+
+ + } + className="px-4"> + 个人设置 + + } + onClick={() => { + navigate("/admin/staff"); + }} + className="px-4"> + 后台管理 + + } + onClick={async () => await logout()} + className="px-4 text-red-500 hover:text-red-600 hover:bg-red-50"> + 退出登录 + + + ) : ( + navigate("/login")} + className="px-4 text-blue-500 hover:text-blue-600 hover:bg-blue-50"> + 登录/注册 + + )} +
+ ); +};