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,