diff --git a/src/components/InvitingPersonnelModal/index.tsx b/src/components/InvitingPersonnelModal/index.tsx index 10feb4c..52fba6f 100644 --- a/src/components/InvitingPersonnelModal/index.tsx +++ b/src/components/InvitingPersonnelModal/index.tsx @@ -7,10 +7,11 @@ import { useLocation } from 'react-router-dom'; import { GetRoomUser, PostRoomInvite } from '@/api/Meeting'; import { storage } from '@/utils'; import Avatar from '@/components/Avatar'; -let userInfo = JSON.parse(storage.getItem('user') as string) const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { useImperativeHandle(ref, () => ({ changeInvitingPersonnelModal: () => { + let userInfo = JSON.parse(storage.getItem('user') as string) + setUser(userInfo) setCheckedList([]) getUserList() setIsInvitingPersonnelModal(true) @@ -19,6 +20,7 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { const { state } = useLocation(); const [isInvitingPersonnelModal, setIsInvitingPersonnelModal] = useState(false); const [isFirstRender, setIsFirstRender] = useState(true); + const [user, setUser] = useState(''); const [optionsValue, setOperationValue] = useState(1); const [list, setList] = useState({ data: [], @@ -146,9 +148,9 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => { return checkedList } }) - }} disabled={!item.isOnline || item.account === userInfo.account || item.disabled} checked={item.checked}> + }} disabled={!item.isOnline || item.account === user.account || item.disabled} checked={item.checked}>
- {item.userName}{item.account === userInfo.account ? '(我)' : ''}{item.disabled ? '(已入会)' : ''} + {item.userName}{item.account === user.account ? '(我)' : ''}{item.disabled ? '(已入会)' : ''}
{item.isOnline ? '在线' : '离线'}
) : 暂无数据} @@ -174,17 +176,12 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {