邀请完成

This commit is contained in:
yj 2024-07-19 16:48:02 +08:00
parent d7eaf1584d
commit 7a75abc22c
5 changed files with 27 additions and 10 deletions

View File

@ -72,7 +72,7 @@ const App: React.FC = () => {
break;
}
})
}, [])
}, [navigate])
const handleResize = (): void => {
setWindowSize({
width: window.innerWidth,

View File

@ -6,6 +6,7 @@ import { SearchOutlined } from '@ant-design/icons';
import { GetUserList } from '@/api/Home/User';
import { useLocation } from 'react-router-dom';
import { PostRoomInvite } from '@/api/Meeting';
import { storage } from '@/utils';
const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
useImperativeHandle(ref, () => ({
changeInvitingPersonnelModal: () => {
@ -164,8 +165,18 @@ const InvitingPersonnelModal = forwardRef((props: any, ref: any) => {
<Button type="primary" onClick={() => { setIsInvitingPersonnelModal(false) }} style={{ backgroundColor: '#31353A', marginRight: '14px' }}></Button>
<Button type="primary" className='m-ant-btn' onClick={() => {
if (checkedList.length) {
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id))
setIsInvitingPersonnelModal(false)
let userInfo = JSON.parse(storage.getItem('user') as string)
let me = checkedList.find((item: any) => item.id === userInfo.uid)
if (me) {
message.error('您不能邀请自己')
} else {
PostRoomInvite(state.roomId, checkedList.map((item: any) => item.id)).then(res => {
if (res.code === 200) {
message.success('邀请成功')
setIsInvitingPersonnelModal(false)
}
})
}
} else {
message.error('请选择人员')
}

View File

@ -52,6 +52,10 @@ const JoinMeetingModal = forwardRef((props: any, ref: any) => {
<span></span>
</div>
<div onClick={() => {
if (location.hash.indexOf('/meeting') !== -1) {
setIsJoinMeetingModal(false)
return message.error('您已经在房间中了,请退出房间重试。')
}
isGetCheckoutRoomNum(info.roomNum, (bool: boolean) => {
if (bool) {
getRoomRtcToken(info.roomNum, (token: string) => {

View File

@ -638,7 +638,7 @@ const Meeting: React.FC = () => {
}
)}
</div>
<div className={`${styles.meetingUserListFooter} drag`}>
<div className={`${styles.meetingUserListFooter} drag`} onClick={() => invitingPersonnelRef.current.changeInvitingPersonnelModal()}>
<div></div>
<div onClick={() => postOpenMicr(false, true)}></div>
</div>

View File

@ -17,12 +17,14 @@ export const startSignalr = () => {
}
export const onInvitation = (callBack: Function) => {
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
callBack({
key: 'Invitation',
roomNum, roomName, InviterName
})
});
if (connection) {
connection.on("Invitation", (roomNum: string, roomName: string, InviterName: string) => {
callBack({
key: 'Invitation',
roomNum, roomName, InviterName
})
});
}
}
export const onSignalr = (callBack: Function) => {
if (connection) {