From 54849757852f6ab40eb17afbd03d1d839b60a38d Mon Sep 17 00:00:00 2001
From: guoshilong <123456>
Date: Mon, 13 Nov 2023 17:09:15 +0800
Subject: [PATCH] 重复定时和连续执行
---
src/websocket/util/config.ts | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/src/websocket/util/config.ts b/src/websocket/util/config.ts
index 46c8c2e..a8ab912 100644
--- a/src/websocket/util/config.ts
+++ b/src/websocket/util/config.ts
@@ -1,8 +1,17 @@
import { ELocalStorageKey } from '/@/types/enums'
import { CURRENT_CONFIG } from '/@/api/http/config'
+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 = 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