dca71a02f96a62589e51c8634ccb63271d5bbf07..648904d076ae6e17892b40675598b1c8dc474277
2026-04-24 罗广辉
Merge branch 'feature/v9.0/9.0.3' into feature/v9.0/9.0.4
648904 diff | tree
2026-04-22 chenyao
feat:增加心跳机制
cd1f36 diff | tree
2026-04-10 罗广辉
feat: 去除通话demo
c65e94 diff | tree
4 files modified
23 files deleted
18923 ■■■■ changed files
package.json 1 ●●●● patch | view | raw | blame | history
pnpm-lock.yaml 15486 ●●●●● patch | view | raw | blame | history
src/hooks/useGlobalWS.js 27 ●●●● patch | view | raw | blame | history
src/manifest.json 14 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/GenerateTestUserSig.js 16 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/._lib patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/PaxHeader/lib patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcCloudImpl.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcCode.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcDefines.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/._constants.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/._index.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcCloudImpl.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcCode.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcDefines.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/constants.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/index.js patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcCloudImpl.js 790 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcCode.js 612 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcDefines.js 522 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/constants.js 10 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/lib/index.js 1086 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/permission.js 279 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/view/TrtcLocalView.nvue 19 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/TrtcCloud/view/TrtcRemoteView.nvue 23 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/index.js 36 ●●●●● patch | view | raw | blame | history
src/utils/voiceCallByTX/lib-generate-test-usersig-es.min.js 2 ●●●●● patch | view | raw | blame | history
package.json
@@ -82,7 +82,6 @@
    "leaflet": "^1.9.4",
    "pinia": "2.2.4",
    "pinia-plugin-persistedstate": "4.1.3",
    "trtc-sdk-v5": "^5.14.1",
    "uview-plus": "^3.5.41",
    "vue": "3.4.21",
    "vue-i18n": "9.1.9",
pnpm-lock.yaml
Diff too large
src/hooks/useGlobalWS.js
@@ -1,9 +1,9 @@
import {useUserStore} from "@/store/index.js";
import {getEnvObj} from "@/utils/index.js";
import {enterRoom} from "@/utils/voiceCallByTX/index.js";
import useAppStore from "../store/modules/app/index.js";
let socketTask = null
let heartbeatTimer = null
export function useGlobalWS() {
    const userStore = useUserStore();
@@ -30,9 +30,6 @@
                    url: '/pages/login/index'
                })
                break
            case 'VoiceCall':
                enterRoom(payload, userId.value)
                break
            default:
                break;
        }
@@ -40,6 +37,7 @@
    // 关闭ws
    function closeWS() {
    stopHeartbeat()
        socketTask?.close({
            success: () => {
                console.log('ws关闭连接');
@@ -80,7 +78,7 @@
    // 监听连接关闭
    socketTask.onClose((res) => {
      console.log(`WebSocket连接关闭,代码: ${res.code}, 原因: ${res.reason}`)
      startHeartbeat()
      // 根据不同的关闭代码处理
      if (res.code === 1000) { // 正常关闭
        console.log('连接正常关闭')
@@ -99,6 +97,25 @@
    })
    }
  function startHeartbeat() {
    stopHeartbeat()
    heartbeatTimer = setInterval(() => {
      if (socketTask && socketTask.readyState === 1) {
        // 尝试以 JSON 格式发送,并降低频率(30秒一次)以减少服务器负担
        socketTask.send({
          data: JSON.stringify({ type: 'ping', timestamp: Date.now() })
        });
      }
    }, 30000)
  }
  function stopHeartbeat() {
    if (heartbeatTimer) {
      clearInterval(heartbeatTimer)
      heartbeatTimer = null
    }
  }
    watch(access_token, initWS, {immediate: true})
}
src/manifest.json
@@ -69,20 +69,6 @@
            }
        },
        "nativePlugins" : {
            "TRTCCloudUniPlugin-TRTCCloudImpl" : {
                "__plugin_info__" : {
                    "name" : "【官方】腾讯云实时音视频SDK",
                    "description" : "uni-app TRTC SDK 是腾讯云实时音视频通讯解决方案在 uni-app 上的 SDK,提供实时音视频服务",
                    "platforms" : "Android,iOS",
                    "url" : "https://ext.dcloud.net.cn/plugin?id=7774",
                    "android_package_name" : "uni.app.UNI0981D7F",
                    "ios_bundle_id" : "",
                    "isCloud" : true,
                    "bought" : 1,
                    "pid" : "7774",
                    "parameters" : {}
                }
            }
        }
    },
    /* 快应用特有相关 */
src/utils/voiceCallByTX/GenerateTestUserSig.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/._lib
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/PaxHeader/lib
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcCloudImpl.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcCode.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/._TrtcDefines.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/._constants.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/._index.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcCloudImpl.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcCode.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/TrtcDefines.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/constants.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/PaxHeader/index.js
Binary files differ
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcCloudImpl.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcCode.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/lib/TrtcDefines.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/lib/constants.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/lib/index.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/permission.js
File was deleted
src/utils/voiceCallByTX/TrtcCloud/view/TrtcLocalView.nvue
File was deleted
src/utils/voiceCallByTX/TrtcCloud/view/TrtcRemoteView.nvue
File was deleted
src/utils/voiceCallByTX/index.js
File was deleted
src/utils/voiceCallByTX/lib-generate-test-usersig-es.min.js
File was deleted