diff --git a/src/pages/dashboard/workplace/overview.tsx b/src/pages/dashboard/workplace/overview.tsx index 78ee815..2ff1479 100644 --- a/src/pages/dashboard/workplace/overview.tsx +++ b/src/pages/dashboard/workplace/overview.tsx @@ -61,7 +61,7 @@ function Overview() { const [loading, setLoading] = useState(true); const t = useLocale(locale); - const userInfo = useSelector((state: any) => state.userInfo || {}); + const userInfo = useSelector((state: any) => state.user?.userInfo || {}); const fetchData = async () => { setLoading(true); @@ -79,7 +79,7 @@ function Overview() { {t['workplace.welcomeBack']} - {userInfo.name} + {userInfo.username} diff --git a/src/store/user.ts b/src/store/user.ts index 849b4ba..44ac889 100644 --- a/src/store/user.ts +++ b/src/store/user.ts @@ -3,6 +3,7 @@ import { createSlice } from '@reduxjs/toolkit'; export interface UserState { userInfo?: { name?: string; + username?: string; avatar?: string; job?: string; organization?: string;