From 7f98f145d43272ed8d51dbb4c203b0c9fc23aa0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 3 Nov 2025 10:17:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(websocket):=20=E6=B7=BB=E5=8A=A0WebSocket?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=9B=91=E6=8E=A7=E9=A1=B5=E9=9D=A2=E5=92=8C?= =?UTF-8?q?=E4=BB=A3=E7=90=86=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增WebSocket数据监控页面,包含四种图表展示实时数据,支持数据类型切换 更新vue.config.js添加WebSocket代理配置 添加IDE配置文件到.gitignore --- .gitignore | 2 + apps/l2/src/views/l2/socket/index.vue | 637 ++++++++++++++++++++++++++ apps/l2/vue.config.js | 11 +- 3 files changed, 649 insertions(+), 1 deletion(-) create mode 100644 apps/l2/src/views/l2/socket/index.vue diff --git a/.gitignore b/.gitignore index 78aadb2..4a95601 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ node_modules .pnp .pnp.js +.idea +.vscode # Turbo .turbo diff --git a/apps/l2/src/views/l2/socket/index.vue b/apps/l2/src/views/l2/socket/index.vue new file mode 100644 index 0000000..78e592f --- /dev/null +++ b/apps/l2/src/views/l2/socket/index.vue @@ -0,0 +1,637 @@ + + + + + \ No newline at end of file diff --git a/apps/l2/vue.config.js b/apps/l2/vue.config.js index 4e8e21d..fd96f0f 100644 --- a/apps/l2/vue.config.js +++ b/apps/l2/vue.config.js @@ -39,7 +39,16 @@ module.exports = { pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: '' } - } + }, + // 新增WebSocket代理配置 + // '/ws-api': { // 匹配前端WebSocket连接的路径(如ws://localhost:80/ws-api) + // target: '140.143.206.120:8089', // 目标WebSocket服务地址 + // ws: true, // 启用WebSocket代理 + // changeOrigin: true, // 改变请求源,解决跨域问题 + // pathRewrite: { + // '^/ws-api': '' // 如果目标服务不需要路径前缀,可移除 + // } + // } }, disableHostCheck: true },