From a032c6114fd03ec78cc9505938b5f8db866c99d3 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 12 Dec 2024 12:54:50 +0800 Subject: [PATCH] no message --- app/Services/WebSocketService.php | 4 ++++ docker-compose.yml | 2 +- resources/assets/js/App.vue | 15 ++++++++++++--- resources/assets/js/store/actions.js | 2 +- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/app/Services/WebSocketService.php b/app/Services/WebSocketService.php index c3c727042..62e96005d 100644 --- a/app/Services/WebSocketService.php +++ b/app/Services/WebSocketService.php @@ -103,6 +103,10 @@ class WebSocketService implements WebSocketHandlerInterface case 'receipt': return; + // 握手信息 + case 'handshake': + break; + // 访问状态 case 'path': $row = WebSocket::whereFd($frame->fd)->first(); diff --git a/docker-compose.yml b/docker-compose.yml index 7ce9a5c3f..5c8d8379d 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -167,7 +167,7 @@ services: ai: container_name: "dootask-ai-${APP_ID}" - image: "kuaifan/dootask-ai:0.2.0" + image: "kuaifan/dootask-ai:0.2.2" environment: REDIS_HOST: "${REDIS_HOST}" REDIS_PORT: "${REDIS_PORT}" diff --git a/resources/assets/js/App.vue b/resources/assets/js/App.vue index 8ec0b2798..6bba81444 100755 --- a/resources/assets/js/App.vue +++ b/resources/assets/js/App.vue @@ -179,10 +179,19 @@ export default { $A.updateTimezone() this.__windowTimer && clearTimeout(this.__windowTimer) + this.__timeoutTimer && clearTimeout(this.__timeoutTimer) this.__windowTimer = setTimeout(async () => { try { await this.$store.dispatch("call", {url: "users/socket/status"}) - await this.$store.dispatch("websocketSend", {type: 'handshake'}) + await new Promise((resolve, reject) => { + this.$store.dispatch("websocketSend", { + type: 'handshake', + callback: (_, ok) => { + ok ? resolve() : reject(new Error('Handshake failed')); + } + }); + this.__timeoutTimer = setTimeout(() => reject(new Error('Handshake timeout')), 6000); + }); } catch { await this.$store.dispatch("websocketConnection") } @@ -351,7 +360,7 @@ export default { 'meetings.vonage.com', // Vonage Video 'voovmeeting.com', // 腾讯会议国际版 'skype.com', // Skype - + // 需要调用系统API的场景 'maps.google.com', // Google地图 'maps.apple.com', // 苹果地图 @@ -437,7 +446,7 @@ export default { 'twitter://', // Twitter 'instagram://', // Instagram 'linkedin://' // LinkedIn - ]; + ]; const lowerUrl = `${url}`.toLowerCase() return meetingDomains.some(domain => lowerUrl.indexOf(domain) !== -1); }, diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js index 2efaf3ec9..d2158e7bd 100644 --- a/resources/assets/js/store/actions.js +++ b/resources/assets/js/store/actions.js @@ -4030,7 +4030,7 @@ export default { return } if (typeof callback === "function") { - msgId = $A.randomString(16) + msgId = type + '_' + $A.randomString(3) state.wsCall[msgId] = callback } try {