@@ -537,10 +537,10 @@ getList()
border: 1px solid #05FEFF!important;
background-color: transparent!important;
.el-select__wrapper{
- //height: 53px!important;
+ height: 54px!important;
color: #FFFFFF!important;
font-size: 40px!important;
- height: auto!important;
+ //height: auto!important;
line-height: normal!important;
border-radius: 6px!important;
border: 1px solid #05FEFF!important;
From f5f178f2a23447150c45066c240c1ec81308d7cb Mon Sep 17 00:00:00 2001
From: odjbin <1042039504@qq.com>
Date: Sat, 17 Aug 2024 15:33:42 +0800
Subject: [PATCH 7/7] =?UTF-8?q?fix=20:=20websocket=E4=BB=A3=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 3 ++-
.env.production | 3 ++-
src/views/debug/index.vue | 5 +++--
src/views/tunnel/index.vue | 5 +++--
vite.config.js | 18 ++++++++++++++----
5 files changed, 24 insertions(+), 10 deletions(-)
diff --git a/.env.development b/.env.development
index 8b91019..d59e51c 100644
--- a/.env.development
+++ b/.env.development
@@ -3,4 +3,5 @@
VITE_BASE_URL='/api'
# VITE_BASE_URL='http://192.168.101.7:8000'
-VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+VITE_BASE_WSURL='/websocket'
diff --git a/.env.production b/.env.production
index 8805300..4c27cb7 100644
--- a/.env.production
+++ b/.env.production
@@ -4,4 +4,5 @@ VITE_TITLE='fateverse'
VITE_BASE_URL='/api'
-VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+#VITE_BASE_WSURL='ws://web-tunnel.feashow.com/api'
+VITE_BASE_WSURL='/websocket'
diff --git a/src/views/debug/index.vue b/src/views/debug/index.vue
index b75cad6..740f05e 100644
--- a/src/views/debug/index.vue
+++ b/src/views/debug/index.vue
@@ -74,8 +74,9 @@ const handleSend = () => {
dataList.value.push(data)
}
const initWebSocket = () => {
- // let wsUrl = `ws://192.168.31.175:9000/websocket/debug/${token}/${serialNumber.value}`
- let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}`
+ // let wsUrl = `ws://192.168.31.176:9000/websocket/debug/${token}/${serialNumber.value}`
+ let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
+ // let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/debug/${token}/${serialNumber.value}`
console.log(wsUrl)
socket = new WebSocket(wsUrl)
//连接发生错误的回调方法
diff --git a/src/views/tunnel/index.vue b/src/views/tunnel/index.vue
index 5308035..45180ee 100644
--- a/src/views/tunnel/index.vue
+++ b/src/views/tunnel/index.vue
@@ -565,7 +565,8 @@ const nextBtn = () => {
const initWebSocket = () => {
// let wsUrl = `ws://192.168.31.176:9000/websocket/equipment/${token}/${serialNumber.value}`
- let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
+ // let wsUrl = `ws://web-tunnel.feashow.com/api/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
+ let wsUrl = import.meta.env.VITE_BASE_WSURL+`/${token}/${serialNumber.value}`;
// let wsUrl = `ws://clay.frp.feashow.cn/wstunnel/websocket/equipment/${token}/${serialNumber.value}`;
socket = new WebSocket(wsUrl);
//连接发生错误的回调方法
@@ -578,7 +579,7 @@ const initWebSocket = () => {
};
//接收到消息的回调方法
socket.onmessage = function (event) {
- // console.log("服务器返回的信息: ", JSON.parse(event.data));
+ console.log("服务器返回的信息: ", JSON.parse(event.data));
const type = JSON.parse(event.data).type;
const data = JSON.parse(event.data).data;
if (type === "equipment") {
diff --git a/vite.config.js b/vite.config.js
index 2c31836..999cd67 100644
--- a/vite.config.js
+++ b/vite.config.js
@@ -58,9 +58,12 @@ export default defineConfig({
strictPort: false,
open: true,
proxy: {
- // '/api/tunnel': {
- // // target: 'http://gateway.feashow.cn',
- // target: 'http://192.168.31.175:8000',
+ // // '/api/tunnel': {
+ // '/tunnel': {
+ //
+ // // // target: 'http://gateway.feashow.cn',
+ // target: 'http://frp.feashow.cn:31800/',
+ // // target: 'http://clay.frp.feashow.cn',
// changeOrigin: true,
// rewrite: (path) => path.replace(/^\/api/, ''),
// },
@@ -72,13 +75,20 @@ export default defineConfig({
// },
'/api': {
target: 'http://web-tunnel.feashow.com/api',
- // target: 'http://192.168.31.175:8000',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, ''),
},
'/socket': {
target: 'ws://web-tunnel.feashow.com/api/notice-ws/notice',
ws: true
+ },
+ '/websocket': {
+ target: 'ws://web-tunnel.feashow.com/api/wstunnel/websocket/equipment',
+ // target: 'ws://192.168.31.176:9000/websocket/debug',
+ changeOrigin: true,
+ ws: true,
+
+ rewrite: (path) => path.replace(/^\/websocket/, '')
}
}
}