This commit is contained in:
yj 2024-08-09 17:57:43 +08:00
parent 064aa893c5
commit 96b1ba5b41
3 changed files with 6 additions and 22 deletions

View File

@ -61,16 +61,18 @@ export const PostOpenCamera = (data: any) =>
data data
}) })
export const PostRoomManager = (roomId: string, roomNum: string) => export const PostRoomManager = (roomId: string, roomNum: string, uid: string) =>
request({ request({
url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`, url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`,
method: 'post', method: 'post',
data: uid
}) })
export const DeleteRoomManager = (roomId: string, roomNum: string) => export const DeleteRoomManager = (roomId: string, roomNum: string, uid: string) =>
request({ request({
url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`, url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`,
method: 'delete', method: 'delete',
data: uid
}) })
export const GetRoomKickout = (roomNum: string, kickUid: string) => export const GetRoomKickout = (roomNum: string, kickUid: string) =>

View File

@ -258,14 +258,12 @@ const Meeting: React.FC = () => {
// 扩展操作 // 扩展操作
case 'Operation': case 'Operation':
// 1:全员退出会议 // 1:全员退出会议
// 2:设置取消管理员
// 3:踢出房间 // 3:踢出房间
// 4:屏幕共享 // 4:屏幕共享
switch (item.type) { switch (item.type) {
case 1: case 1:
leaveChannel() leaveChannel()
break; break;
case 2:
case 3: case 3:
break; break;
@ -1007,14 +1005,7 @@ const Meeting: React.FC = () => {
style={{ marginBottom: '10px', width: '80%' }} style={{ marginBottom: '10px', width: '80%' }}
size={'small'} size={'small'}
onClick={() => { onClick={() => {
PostRoomManager(state.roomId, state.channelId).then(res => { PostRoomManager(state.roomId, state.channelId, item.uid)
if (res.code === 200) {
onInvoke('sendOper', {
roomNum: state.channelId,
type: 2,
})
}
})
}} }}
></Button> : <Button ></Button> : <Button
type="primary" type="primary"
@ -1022,14 +1013,7 @@ const Meeting: React.FC = () => {
style={{ marginBottom: '10px', width: '80%' }} style={{ marginBottom: '10px', width: '80%' }}
size={'small'} size={'small'}
onClick={() => { onClick={() => {
DeleteRoomManager(state.roomId, state.channelId).then(res => { DeleteRoomManager(state.roomId, state.channelId, item.uid)
if (res.code === 200) {
onInvoke('sendOper', {
roomNum: state.channelId,
type: 2,
})
}
})
}} }}
></Button>} ></Button>}

View File

@ -131,7 +131,6 @@ export const offSignalr = () => {
connection.off('ForceExitRoom'); connection.off('ForceExitRoom');
connection.off('ShowUser'); connection.off('ShowUser');
connection.off('RefreshView'); connection.off('RefreshView');
connection.off('UserJoined'); connection.off('UserJoined');
connection.off('UserLeave'); connection.off('UserLeave');
connection.off('OperAllMicr'); connection.off('OperAllMicr');
@ -147,7 +146,6 @@ export const onInvoke = async (str: string, data: any) => {
break; break;
case 'sendOper': case 'sendOper':
// 1:全员退出会议 // 1:全员退出会议
// 2:设置取消管理员
// 3:踢出房间 // 3:踢出房间
// 4:屏幕共享 // 4:屏幕共享
await connection.invoke(str, data.roomNum, data.type) await connection.invoke(str, data.roomNum, data.type)