From aec00ecc093be803860c8675cbe1c4c776a7cb4e Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Tue, 19 Mar 2024 17:49:21 +0800
Subject: [PATCH] update: 新建航线、事件编辑、kmz文件问题修改
---
src/websocket/util/config.ts | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/src/websocket/util/config.ts b/src/websocket/util/config.ts
index 46c8c2e..12fa799 100644
--- a/src/websocket/util/config.ts
+++ b/src/websocket/util/config.ts
@@ -1,8 +1,19 @@
import { ELocalStorageKey } from '/@/types/enums'
import { CURRENT_CONFIG } from '/@/api/http/config'
+const { baseUrl: { wsBaseUrl } } = window.globalApiConfig
+
+const user = localStorage.getItem('user_info')
export function getWebsocketUrl () {
const token: string = localStorage.getItem(ELocalStorageKey.Token) || '' as string
- const url = CURRENT_CONFIG.websocketURL + '?x-auth-token=' + encodeURI(token)
+ // const url = CURRENT_CONFIG.websocketURL
+ const url = (wsBaseUrl || import.meta.env.VITE_WS_API_URL) + '?x-auth-token=' + encodeURI(token)
return url
}
+
+// // 我们自己的webSocket逻辑
+// export function getMyWebSocketUrl () {
+// const obj = JSON.parse(user)
+// const url = CURRENT_CONFIG.websocketURL + '/' + obj.id
+// return url
+// }
--
Gitblit v1.9.3