From cd33eb913ff4f9faf9ad1874c0d349e2b083cf2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8E=E8=82=96=E7=A3=8A?= <18851179580@163.com> Date: Tue, 6 Jan 2026 16:53:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=97=A5=E5=BF=97=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pull/components/live-content/live-content.vue | 14 +++++++++----- pages/plugins/live/pull/mixins/mixins.js | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pages/plugins/live/pull/components/live-content/live-content.vue b/pages/plugins/live/pull/components/live-content/live-content.vue index 50eea6a7..255f92d9 100644 --- a/pages/plugins/live/pull/components/live-content/live-content.vue +++ b/pages/plugins/live/pull/components/live-content/live-content.vue @@ -541,13 +541,16 @@ this.is_socket_error = true; // 尝试重连,最多30次 if ((this.reconnect_count + 1) < 30) { + const _this = this; setTimeout(() => { - this.is_socket_error = true; - this.socket_error_content = `第${this.reconnect_count + 1}次连接失败`; + _this.is_socket_error = true; + _this.socket_error_content = `第${_this.reconnect_count + 1}次连接失败`; + console.log(`第${_this.reconnect_count + 1}次连接失败`); setTimeout(() => { // 增加重连计数 - this.reconnect_count++; - this.socket_connect(); + _this.reconnect_count++; + _this.socket_connect(); + console.log(`第${_this.reconnect_count + 1}次连接`); }, 1000); // 逐步增加重连间隔,最大10秒 }, 1000); // 逐步增加重连间隔,最大10秒 } else { @@ -745,12 +748,13 @@ clearInterval(this.pull_live_room_info_timer); this.pull_live_room_info_timer = null; } - + console.log('立即获取直播间数据'); // 立即发送获取直播间数据消息 this.socket_send('live-room-info'); // 每30秒发送一次获取直播间数据消息 this.pull_live_room_info_timer = setInterval(() => { + console.log('定时获取直播间数据'); this.socket_send('live-room-info'); }, this.live_room_info_timing_interval_time * 1000); }, diff --git a/pages/plugins/live/pull/mixins/mixins.js b/pages/plugins/live/pull/mixins/mixins.js index ff4ee9da..6314eccd 100644 --- a/pages/plugins/live/pull/mixins/mixins.js +++ b/pages/plugins/live/pull/mixins/mixins.js @@ -211,6 +211,7 @@ export default { const _this = this; // 延迟3秒后尝试重新连接 this.ended_timer = setTimeout(() => { + console.log('视频重连次数' + _this.retry_count); // 在定时结束后尝试重新连接 if (_this.$refs.liveVideo) { _this.$refs.liveVideo.reload_video();