From f33f36282c9a7aa541fb60c1e2184cd4ac2c8071 Mon Sep 17 00:00:00 2001
From: GuLiMmo <2820890765@qq.com>
Date: Wed, 24 Jan 2024 16:25:17 +0800
Subject: [PATCH] chore: 默认赋值

---
 src/websocket/util/config.ts |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/websocket/util/config.ts b/src/websocket/util/config.ts
index a8ab912..12fa799 100644
--- a/src/websocket/util/config.ts
+++ b/src/websocket/util/config.ts
@@ -1,11 +1,13 @@
 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
-  const url = import.meta.env.VITE_WS_API_URL + '?x-auth-token=' + encodeURI(token)
+  const url = (wsBaseUrl || import.meta.env.VITE_WS_API_URL) + '?x-auth-token=' + encodeURI(token)
   return url
 }
 

--
Gitblit v1.9.3