From fed9b95989a66c48ae176de4c3cf26ccb5a16b85 Mon Sep 17 00:00:00 2001 From: XiaoXinPro 14 IAH5R <568170040@qq.com> Date: Mon, 24 Jul 2023 17:24:01 +0800 Subject: [PATCH] upload --- src/views/realTimeChat/realTimeChat.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/views/realTimeChat/realTimeChat.vue b/src/views/realTimeChat/realTimeChat.vue index bc9ed73..73ae232 100644 --- a/src/views/realTimeChat/realTimeChat.vue +++ b/src/views/realTimeChat/realTimeChat.vue @@ -89,6 +89,7 @@ export default { inputText: "", screenWidth: document.documentElement.clientWidth, screenHeight: document.documentElement.clientHeight, + socket: null, }; }, computed: { @@ -114,6 +115,13 @@ export default { expendChatBox() { this.isExpend = !this.isExpend; }, + + socketOnLink() { + this.socket = new WebSocket("wss://43.143.227.135:8989/webrtc"); + this.socket.onclose = function (evt) { + console.log("连接已断开."); + }; + }, }, created() {}, mounted() { @@ -122,6 +130,7 @@ export default { this.videoUrl = "https://video.metavatar.cc/sv/d51a6f6-187fa2dff79/d51a6f6-187fa2dff79.mp4"; this.loading = true; + this.socketOnLink(); }, };