Commit a91f92b2 authored by Bill's avatar Bill

Merge branch 'fix-v2-220418-home-bug' into 'v2-220418'

fix: 修改首页会员无等级时显示错误,以及用户名显示错误 See merge request linkseeks-design/pro-platform!134
parents 22202ae7 8fe13843
...@@ -12,6 +12,7 @@ import { ReactComponent as DefaultAvatar } from '@/assets/imgs/default_avatar.sv ...@@ -12,6 +12,7 @@ import { ReactComponent as DefaultAvatar } from '@/assets/imgs/default_avatar.sv
const AvatarDropdown = (props) => { const AvatarDropdown = (props) => {
const intl = useIntl(); const intl = useIntl();
const userAuth = getAuth();
const logout = () => { const logout = () => {
removeAuth() removeAuth()
removeRouters() removeRouters()
...@@ -19,7 +20,7 @@ const AvatarDropdown = (props) => { ...@@ -19,7 +20,7 @@ const AvatarDropdown = (props) => {
} }
const currentUser = { const currentUser = {
name: getAuth()?.company || intl.formatMessage({id: 'common.weizhiyonghu'}), name: userAuth.name || userAuth?.company || intl.formatMessage({id: 'common.weizhiyonghu'}),
avatar: props.UserStore.avatar || '', avatar: props.UserStore.avatar || '',
} }
......
...@@ -159,13 +159,14 @@ ...@@ -159,13 +159,14 @@
justify-content: center; justify-content: center;
width: 140px; width: 140px;
margin-right: auto; margin-right: auto;
margin-right: 16px;
.levelImg { .levelImg {
height: 16px; height: 16px;
} }
} }
.score { .score {
width: 140px; // width: 140px;
text-align: center; text-align: center;
margin-right: auto; margin-right: auto;
} }
......
...@@ -68,6 +68,26 @@ const UserCenter: React.FC<Iprops> = (props) => { ...@@ -68,6 +68,26 @@ const UserCenter: React.FC<Iprops> = (props) => {
const isVerifyFail = useMemo(() => [2, 4].includes(userAuth.validateStatus), [userAuth]); const isVerifyFail = useMemo(() => [2, 4].includes(userAuth.validateStatus), [userAuth]);
const renderUserLevelAndScore = () => {
if (enableMultiTenancy) {
return null;
}
return (
<>
{
userAuth.levelTag && (
<div className={styles.level}>
{intl.formatMessage({ id: 'home.userCenter.level' })}<StatusTag type={'primary'} title={userAuth.levelTag} />
</div>
) || null
}
<div className={styles.score}>
{intl.formatMessage({ id: 'home.userCenter.score' })}<strong>{userAuth.score}</strong>
</div>
</>
)
}
return ( return (
<div className={styles.container}> <div className={styles.container}>
<div className={styles.header}> <div className={styles.header}>
...@@ -140,16 +160,7 @@ const UserCenter: React.FC<Iprops> = (props) => { ...@@ -140,16 +160,7 @@ const UserCenter: React.FC<Iprops> = (props) => {
</div> </div>
<div className={styles.otherValues}> <div className={styles.otherValues}>
<div className={styles.divider}> <div className={styles.divider}>
{!enableMultiTenancy && ( {renderUserLevelAndScore()}
<>
<div className={styles.level}>
{intl.formatMessage({ id: 'home.userCenter.level' })}<StatusTag type={'primary'} title={userAuth.levelTag} />
</div>
<div className={styles.score}>
{intl.formatMessage({ id: 'home.userCenter.score' })}<strong>{userAuth.score}</strong>
</div>
</>
)}
{ {
userAuth.urls.includes(USER_CENTER_URL) && ( userAuth.urls.includes(USER_CENTER_URL) && (
<Link to={USER_CENTER_URL} className={styles.link}>{intl.formatMessage({ id: 'home.userCenter.userAuth.link' })}</Link> <Link to={USER_CENTER_URL} className={styles.link}>{intl.formatMessage({ id: 'home.userCenter.userAuth.link' })}</Link>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment