GuLiMmo
2023-11-29 7d9fb50b4e444ba3afec098ad031e93b4e9ee9ee
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
}