This commit is contained in:
yj 2024-07-16 14:13:50 +08:00
parent 20000d0b98
commit c2a2729bb9
2 changed files with 15 additions and 7 deletions

View File

@ -40,11 +40,19 @@ export const GetRoomUser = (roomNum: string) =>
}) })
export const PostOpenMicr = (data: any) => export const PostOpenMicr = (data: any) => {
request({ let url = '';
url: `/room/oper-micr?roomNum=${data.roomNum}&enableMicr=${data.enableMicr}&uid=${data.uid}`, if (typeof data.isAll === 'boolean') {
url = `/room/oper-micr?roomNum=${data.roomNum}&enableMicr=${data.enableMicr}&uid=${data.uid}&isAll=${data.isAll}`;
} else {
url = `/room/oper-micr?roomNum=${data.roomNum}&enableMicr=${data.enableMicr}&uid=${data.uid}`;
}
return request({
url,
method: 'get', method: 'get',
}) })
}
export const PostOpenCamera = (data: any) => export const PostOpenCamera = (data: any) =>
request({ request({

View File

@ -215,13 +215,13 @@ const Meeting: React.FC = () => {
footerListTemplate[itemIndex][rowIndex].title = '开启声音' footerListTemplate[itemIndex][rowIndex].title = '开启声音'
footerListTemplate[itemIndex][rowIndex].active = true footerListTemplate[itemIndex][rowIndex].active = true
setFooterList(footerListTemplate) setFooterList(footerListTemplate)
postOpenMicr(false, false) postOpenMicr(false)
break; break;
case '开启声音': case '开启声音':
footerListTemplate[itemIndex][rowIndex].title = '关闭声音' footerListTemplate[itemIndex][rowIndex].title = '关闭声音'
footerListTemplate[itemIndex][rowIndex].active = false footerListTemplate[itemIndex][rowIndex].active = false
setFooterList(footerListTemplate) setFooterList(footerListTemplate)
postOpenMicr(true, false) postOpenMicr(true)
break; break;
case '关闭视频': case '关闭视频':
footerListTemplate[itemIndex][rowIndex].title = '开启视频' footerListTemplate[itemIndex][rowIndex].title = '开启视频'
@ -357,7 +357,7 @@ const Meeting: React.FC = () => {
} }
// 开关麦克风 // 开关麦克风
const postOpenMicr = async (enableMicr: boolean, isAll: boolean): Promise<void> => { const postOpenMicr = async (enableMicr: boolean, isAll?: boolean): Promise<void> => {
await PostOpenMicr({ await PostOpenMicr({
roomNum: state.channelId, roomNum: state.channelId,
uid: user.uid, uid: user.uid,
@ -457,7 +457,7 @@ const Meeting: React.FC = () => {
</div> </div>
<div className={`${styles.meetingUserListFooter} drag`}> <div className={`${styles.meetingUserListFooter} drag`}>
<div></div> <div></div>
<div onClick={() => postOpenMicr(true, true)}></div> <div onClick={() => postOpenMicr(true, false)}></div>
</div> </div>
</div> </div>
: :