fix(overview): 修复首页未能正确展示用户名的问题

feature
钟良源 1 month ago
parent 6dad941b96
commit 8bc11c0de1

@ -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() {
<Card>
<Typography.Title heading={5}>
{t['workplace.welcomeBack']}
{userInfo.name}
{userInfo.username}
</Typography.Title>
<Divider />
<Row>

@ -3,6 +3,7 @@ import { createSlice } from '@reduxjs/toolkit';
export interface UserState {
userInfo?: {
name?: string;
username?: string;
avatar?: string;
job?: string;
organization?: string;

Loading…
Cancel
Save