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
})
export const PostRoomManager = (roomId: string, roomNum: string) =>
export const PostRoomManager = (roomId: string, roomNum: string, uid: string) =>
request({
url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`,
method: 'post',
data: uid
})
export const DeleteRoomManager = (roomId: string, roomNum: string) =>
export const DeleteRoomManager = (roomId: string, roomNum: string, uid: string) =>
request({
url: `/room/manager?roomId=${roomId}&roomNum=${roomNum}`,
method: 'delete',
data: uid
})
export const GetRoomKickout = (roomNum: string, kickUid: string) =>

View File

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

View File

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