diff --git a/src/routes/layout/dashboard-layout.tsx b/src/routes/layout/dashboard-layout.tsx index 6a71d8f..1ce5a52 100644 --- a/src/routes/layout/dashboard-layout.tsx +++ b/src/routes/layout/dashboard-layout.tsx @@ -12,7 +12,7 @@ import {IconExit, IconUser} from "@douyinfe/semi-icons"; import styled from "@emotion/styled"; import useConfig from "@/hooks/useConfig.ts"; import {IconRoles} from "@/components/icons"; -import {setCurrentRole} from "@/contexts/auth"; +// import {setCurrentRole} from "@/contexts/auth"; const {Header, Content, Sider} = Layout; @@ -42,15 +42,10 @@ export const HeaderUserAvatar = () => {
{user?.username} -
+
Department:{user?.department?.toUpperCase() || "N/A"} -
-
- Role:{user?.role?.toUpperCase()} + size={'small'}>{user?.department?.toUpperCase() || "N/A"}
@@ -66,36 +61,22 @@ export const HeaderUserAvatar = () => { ) } -const RoleList: UserRole[] = ['root', 'ro', 'fo','staff'] +// const RoleList: UserRole[] = ['root', 'ro', 'fo','staff'] const RoleSwitcher = ()=>{ - const {user, updateUser} = useAuth() + const {user} = useAuth() // update user role - const changeRole = (role:UserRole)=>{ - updateUser({role}).then(()=>{ - setCurrentRole(role) - }) - } + // const changeRole = (role:UserRole)=>{ + // updateUser({role}).then(()=>{ + // setCurrentRole(role) + // }) + // } return (<> - {user?.origin_role == 'root' && ( - {RoleList.map((key) => ( - changeRole(key)} - >{key.toUpperCase()} - ))} - - } - > - - ) } + ) } export const CommonHeader: React.FC = ({children, title, rightExtra}) => {