From f959c6bcc4a26eb93d01d9adc3041c373f8b9169 Mon Sep 17 00:00:00 2001 From: republicline Date: Fri, 4 Jul 2025 12:40:37 +0800 Subject: [PATCH] =?UTF-8?q?1,=20=E8=BF=9C=E7=A8=8B=E6=8E=A7=E5=88=B6,=20?= =?UTF-8?q?=E5=BE=85=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/stores/remote-ws-store.ts | 16 +- src/views/remote-manage/remote-control.vue | 2038 ++++++++++---------- vite.config.ts | 8 +- 3 files changed, 1002 insertions(+), 1060 deletions(-) diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts index c0bf1ce..508be9a 100644 --- a/src/stores/remote-ws-store.ts +++ b/src/stores/remote-ws-store.ts @@ -249,7 +249,21 @@ export const useRemoteWsStore = defineStore("remoteWs", { patient.vitalWS.onmessage = undefined; } }, - + createChatConnect(name: string, id: string, date: string, index: number) { + if (!this.patient[name + id + date + index]) this.patient[name + id + date + index] = {} + const patient = this.patient[name + id + date + index] + if (!patient['chatWS']) { + patient['chatWS'] = new WebSocket(chatUrl) + patient.chatWS.onopen = function () { + patient.chatWS.send(JSON.stringify({ + patientName: name, + idNum: id, + date: date, + msgType: "init" + })) + } + } + }, sendMsg(name: string, id: string, date: string, msg: string, index: number, cb: any) { const patient: any = this.patient[name + id + date + index] if (patient) { diff --git a/src/views/remote-manage/remote-control.vue b/src/views/remote-manage/remote-control.vue index 6529c5b..efb3e27 100644 --- a/src/views/remote-manage/remote-control.vue +++ b/src/views/remote-manage/remote-control.vue @@ -1,231 +1,223 @@ diff --git a/vite.config.ts b/vite.config.ts index 160e5ae..5c09ec5 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,15 +26,15 @@ export default defineConfig({ server: { proxy: { '/api': { - // target: 'http://127.0.0.1:6379', // 目标服务器地址 - target: 'http://110.41.142.124:6379', // 目标服务器地址 + target: 'http://127.0.0.1:6379', // 目标服务器地址 + // target: 'http://110.41.142.124:6379', // 目标服务器地址 ws: true, // 是否启用 WebSocket changeOrigin: true, // 是否修改请求头中的 Origin 字段 rewrite: (path) => path.replace(/^\/api/, ''), }, '/socket.io': { - // target: 'ws://127.0.0.1:6379', - target: 'ws://110.41.142.124:6379', + target: 'ws://127.0.0.1:6379', + // target: 'ws://110.41.142.124:6379', ws: true, changeOrigin: true, rewrite: (path) => path.replace(/^\/socket.io/, ''),