liming 4 dni temu
rodzic
commit
88e39f4c94
1 zmienionych plików z 3 dodań i 3 usunięć
  1. 3 3
      src/views/im/hook/messagesHook.js

+ 3 - 3
src/views/im/hook/messagesHook.js

@@ -111,7 +111,7 @@ export const handleMessageHook = (message, state) => {
   ) {
      console.log("音频在线:接听")
     const video = message.contentType == Constant.ACCEPT_AUDIO_ONLINE
-    startAudioOnline(video);
+    startAudioOnline(video, state);
     return;
   }
   // 音频通话
@@ -182,7 +182,7 @@ export const handleMessageHook = (message, state) => {
 };
 
 // 创建呼叫:开启语音电话
-const startAudioOnline = (video) => { 
+const startAudioOnline = (video, state) => { 
   const rtcStore = useWebRTCStore();
   // 初始化webrtc连接
   rtcStore.initConnection(true);
@@ -195,7 +195,7 @@ const startAudioOnline = (video) => {
     })
     .then((offer) => {
       // 发送offer
-      wsStore.sendMessage({
+      state.sendMessage({
         contentType: Constant.AUDIO_ONLINE, // 消息内容类型
         content: JSON.stringify(offer),
         type: Constant.MESSAGE_TRANS_TYPE,