From 931746108bc630b53baa4e8502800a6d60441eb9 Mon Sep 17 00:00:00 2001 From: ac0d3r Date: Sat, 6 May 2023 15:03:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20https=E4=B8=8B=E7=9A=84=E8=BF=9E=E6=8E=A5?= =?UTF-8?q?wss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/Home.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/Home.vue b/frontend/src/Home.vue index e3f8947..a1eeb95 100644 --- a/frontend/src/Home.vue +++ b/frontend/src/Home.vue @@ -77,7 +77,7 @@ const showInput = () => { } // records const records: Ref = ref([]); -const ws = new WebSocket(`ws://${window.location.host}/api/v2/user/record`) +const ws = new WebSocket(`${window.location.protocol === 'https:' ? 'wss' : 'ws'}://${window.location.host}/api/v2/user/record`) ws.onmessage = (msg: any) => { records.value.push(JSON.parse(msg.data)); }