From fb9e8b14ce245b66fd444955b055bc4e1856ce0a Mon Sep 17 00:00:00 2001 From: yj <1336058017@qq.com> Date: Mon, 19 Aug 2024 14:13:43 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/page/Meeting/index.tsx | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/page/Meeting/index.tsx b/src/page/Meeting/index.tsx index 900f68a..b6e4a3b 100644 --- a/src/page/Meeting/index.tsx +++ b/src/page/Meeting/index.tsx @@ -770,6 +770,20 @@ const Meeting: React.FC = () => { // 开关麦克风 const postOpenMicr = async (enableMicr: boolean, uid: string, isAll?: boolean): Promise => { if (getUserRoomInfo()) { + if (!isAll) { + let msg = ''; + if (uid === user.uid) { + await agora.getAudioMediaList().then(res => { + if (!res.ecordingList.length) { + msg = '未检测到麦克风!' + } + }) + } + if (msg) { + message.error(msg) + return + } + } postOpenMicrApi(enableMicr, uid, isAll) } else { message.error(msgTips) @@ -783,18 +797,6 @@ const Meeting: React.FC = () => { enableMicr }) } else { - let msg = ''; - if (uid === user.uid) { - await agora.getAudioMediaList().then(res => { - if (!res.ecordingList.length) { - msg = '未检测到麦克风!' - } - }) - } - if (msg) { - message.error(msg) - return - } await PostOpenMicr({ roomNum: state.channelId, uid, @@ -997,7 +999,7 @@ const Meeting: React.FC = () => { : null} {user.roleId === '1' ? - {item.isRoomManager || item.roleId === '1' ?