Skip to content

Commit 7dd0db5

Browse files
committed
feat: 头像展示优化
1 parent c9b8a48 commit 7dd0db5

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/NoticeIcon/NoticeList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import React from 'react';
44
import classNames from 'classnames';
55
// @ts-ignore
66
import styles from './NoticeList.less';
7+
import Icon from '../Icon';
78

89
export type NoticeIconTabProps = {
910
count?: number;
@@ -55,7 +56,7 @@ const NoticeList: React.FC<NoticeIconTabProps> = ({
5556
// eslint-disable-next-line no-nested-ternary
5657
const leftIcon = item.avatar ? (
5758
typeof item.avatar === 'string' ? (
58-
<Avatar className={styles.avatar} src={item.avatar} />
59+
<Avatar className={styles.avatar} src={item.avatar} icon={<Icon type="user" />} />
5960
) : (
6061
<span className={styles.iconElement}>{item.avatar}</span>
6162
)

src/components/RightContent/AvatarDropdown.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { outLogin } from '@/services/ant-design-pro/api';
1010
import { User, Token } from '@/utils/Ballcat';
1111
import I18n from '@/utils/I18nUtils';
1212
import UrlUtils from '@/utils/UrlUtils';
13+
import Icon from '../Icon';
1314

1415
export type GlobalHeaderRightProps = {
1516
exitConfirm?: boolean;
@@ -101,6 +102,7 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ exitConfirm }) => {
101102
<span className={`${styles.action} ${styles.account}`}>
102103
<Avatar
103104
size="small"
105+
icon={<Icon type="user" />}
104106
className={styles.avatar}
105107
src={user?.info?.avatar ? UrlUtils.resolveImage(user.info.avatar) : undefined}
106108
alt="avatar"

0 commit comments

Comments
 (0)