From 1e524ee55f09d6cc5923564b207cba9e87e8b24d Mon Sep 17 00:00:00 2001
From: wzy-warehouse <18135009705@163.com>
Date: Tue, 12 May 2026 17:45:43 +0800
Subject: [PATCH] =?UTF-8?q?=E5=BB=BA=E7=AB=8Bwebsocket?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 5 +-
.env.production | 5 +-
env.d.ts | 4 +-
src/types/websocket/WebSocketMessage.ts | 11 +
src/types/websocket/WebSocketOptions.ts | 17 +
src/utils/request/websocket.ts | 392 ++++++++++++++++++++++++
6 files changed, 430 insertions(+), 4 deletions(-)
create mode 100644 src/types/websocket/WebSocketMessage.ts
create mode 100644 src/types/websocket/WebSocketOptions.ts
create mode 100644 src/utils/request/websocket.ts
diff --git a/.env.development b/.env.development
index 4efbfb0..5324732 100644
--- a/.env.development
+++ b/.env.development
@@ -7,4 +7,7 @@ VITE_BACKEND_BASE_URL=http://localhost:8081
START_PORT=81
# geoserver地址
-VITE_GEOSERVER_BASE_URL=http://47.92.216.173:4019/geoserver/xian
\ No newline at end of file
+VITE_GEOSERVER_BASE_URL=http://47.92.216.173:4019/geoserver/xian
+
+# WebSocket地址
+VITE_WEBSOCKET_URL=ws://localhost:8081
\ No newline at end of file
diff --git a/.env.production b/.env.production
index 4e01127..b776a57 100644
--- a/.env.production
+++ b/.env.production
@@ -7,4 +7,7 @@ VITE_BACKEND_BASE_URL=http://localhost:8080
START_PORT=80
# geoserver地址
-VITE_GEOSERVER_BASE_URL=http://10.22.245.246/geoserver/xian
\ No newline at end of file
+VITE_GEOSERVER_BASE_URL=http://10.22.245.246/geoserver/xian
+
+# WebSocket地址
+VITE_WEBSOCKET_URL=ws://localhost:8080
\ No newline at end of file
diff --git a/env.d.ts b/env.d.ts
index 288cc92..ef8e726 100644
--- a/env.d.ts
+++ b/env.d.ts
@@ -1,9 +1,8 @@
-NEW_FILE_CODE;
///
declare module '*.vue' {
import type { DefineComponent } from 'vue';
- const component: DefineComponent<{}, {}, any>;
+ const component: DefineComponent