Xiao_123 6 months ago
parent
commit
9f549d4a08
1 changed files with 4 additions and 4 deletions
  1. 4 4
      src/hooks/web/useIM.js

+ 4 - 4
src/hooks/web/useIM.js

@@ -166,9 +166,9 @@ async function getKey () {
     Object.assign(keyQuery, { enterpriseId: userStore.entBaseInfo.enterpriseId })
     console.log('企业模式', keyQuery)
   }
-  const { uid, wsUrl, token } = await getChatKey(keyQuery)
+  const { uid, wssUrl, token } = await getChatKey(keyQuery)
   return {
-    uid, wsUrl, token
+    uid, wssUrl, token
   }
 }
 
@@ -224,10 +224,10 @@ export const useIM = () => {
 
 
   async function resetConfig () {
-    const { uid, wsUrl, token } = await getKey()
+    const { uid, wssUrl, token } = await getKey()
     IM.setUid(uid)
     // 单机模式可以直接设置地址
-    WKSDK.shared().config.addr = 'ws://' + wsUrl // 默认端口为5200
+    WKSDK.shared().config.addr = 'wss://' + wssUrl // 默认端口为5200
     // 认证信息
     WKSDK.shared().config.uid = uid // 用户uid(需要在悟空通讯端注册过)
     WKSDK.shared().config.token = token // 用户token (需要在悟空通讯端注册过)