修复已知问题
This commit is contained in:
@@ -10,6 +10,7 @@ import {TenantId} from "@/utils/config";
|
||||
function UserCard() {
|
||||
const [IsLogin, setIsLogin] = useState<boolean>(false)
|
||||
const [userInfo, setUserInfo] = useState<User>()
|
||||
const [roleName, setRoleName] = useState<string>('注册用户')
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
@@ -52,6 +53,11 @@ function UserCard() {
|
||||
}
|
||||
})
|
||||
}
|
||||
// 判断身份
|
||||
const roleName = Taro.getStorageSync('RoleName');
|
||||
if(roleName){
|
||||
setRoleName(roleName)
|
||||
}
|
||||
}
|
||||
}).catch(() => {
|
||||
console.log('未登录')
|
||||
@@ -159,7 +165,7 @@ function UserCard() {
|
||||
{IsLogin ? (
|
||||
<div className={'grade text-xs py-1'}>
|
||||
<Tag type="success" round>
|
||||
<div className={'p-1'}>{userInfo?.realName || '注册用户'}</div>
|
||||
<div className={'p-1'}>{roleName || '注册用户'}</div>
|
||||
</Tag>
|
||||
</div>
|
||||
) : ''}
|
||||
|
||||
@@ -78,7 +78,7 @@ const UserCell = () => {
|
||||
align="center"
|
||||
extra={<ArrowRight color="#cccccc" size={18}/>}
|
||||
onClick={() => {
|
||||
navTo('/user/bx/index', true)
|
||||
navTo('/hjm/bx/bx', true)
|
||||
}}
|
||||
/>
|
||||
</Cell.Group>
|
||||
@@ -171,15 +171,8 @@ const UserCell = () => {
|
||||
title="账号安全"
|
||||
align="center"
|
||||
extra={<ArrowRight color="#cccccc" size={18}/>}
|
||||
onClick={() => Taro.navigateTo({url: '/user/profile/profile'})}
|
||||
onClick={() => navTo('/user/profile/profile',true)}
|
||||
/>
|
||||
{/*<Cell*/}
|
||||
{/* className="nutui-cell-clickable"*/}
|
||||
{/* title="切换账户"*/}
|
||||
{/* align="center"*/}
|
||||
{/* extra={<ArrowRight color="#cccccc" size={18}/>}*/}
|
||||
{/* onClick={() => Taro.navigateTo({url: '/user/profile/profile'})}*/}
|
||||
{/*/>*/}
|
||||
<Cell
|
||||
className="nutui-cell-clickable"
|
||||
title="退出登录"
|
||||
|
||||
Reference in New Issue
Block a user