From f27ca082eb0a839449dd50c49007b58e5ed6946f Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Thu, 19 Jun 2025 19:08:01 +0800
Subject: [PATCH] feat: 服务名修改

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

diff --git a/src/websocket/util/config.ts b/src/websocket/util/config.ts
index 12fa799..4653047 100644
--- a/src/websocket/util/config.ts
+++ b/src/websocket/util/config.ts
@@ -1,13 +1,20 @@
+/*
+ * @Author: GuLiMmo 2820890765@qq.com
+ * @Date: 2024-03-12 18:01:28
+ * @LastEditors: GuLiMmo 2820890765@qq.com
+ * @LastEditTime: 2024-08-27 16:10:38
+ * @FilePath: /drone-web/src/websocket/util/config.ts
+ * @Description:
+ * Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
+ */
 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 = (wsBaseUrl || import.meta.env.VITE_WS_API_URL) + '?x-auth-token=' + encodeURI(token)
+  const url = (window?.globalApiConfig?.baseUrl?.wsBaseUrl || import.meta.env.VITE_WS_API_URL) + '?x-auth-token=' + encodeURI(token.replace('bearer ', ''))
   return url
 }
 

--
Gitblit v1.9.3