From 6afabf17bc137d9ec7c1a435a2282259f1f417a7 Mon Sep 17 00:00:00 2001 From: republicline Date: Mon, 14 Jul 2025 09:30:16 +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 | 12 ++++++------ vite.config.ts | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/stores/remote-ws-store.ts b/src/stores/remote-ws-store.ts index 508be9a..c14bbe5 100644 --- a/src/stores/remote-ws-store.ts +++ b/src/stores/remote-ws-store.ts @@ -9,14 +9,14 @@ import {ElMessage, ElMessageBox} from "element-plus"; // 服务器部署版本 -const vitalUrl = "ws://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() -const medicineUrl = "ws://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() -const chatUrl = "ws://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() +// const vitalUrl = "ws://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +// const medicineUrl = "ws://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +// const chatUrl = "ws://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() // 服务器部署版本 -// const vitalUrl = "wss://" + window.location.host + "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() -// // const medicineUrl = "wss://" + window.location.host + "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() -// const chatUrl = "wss://" + window.location.host + "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() +const vitalUrl = "/socket.io/admin/rax/vitalSignsMedicine?token=" + Session.getToken() +const medicineUrl = "/socket.io/admin/rax/addMedicine?token=" + Session.getToken() +const chatUrl = "/socket.io/admin/rax/chatRoom?token=" + Session.getToken() export const useRemoteWsStore = defineStore("remoteWs", { diff --git a/vite.config.ts b/vite.config.ts index 5c09ec5..ccc02c6 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -26,14 +26,14 @@ export default defineConfig({ server: { proxy: { '/api': { - target: 'http://127.0.0.1:6379', // 目标服务器地址 + target: 'http://127.0.0.1:6679', // 目标服务器地址 // 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://127.0.0.1:6679', // target: 'ws://110.41.142.124:6379', ws: true, changeOrigin: true,