吉安感知网项目-前端
罗广辉
2026-01-26 beb95fb5fc166804056abafd70fc01ac27de7621
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { ELocalStorageKey } from '@/utils/http/enums'
import { getStore } from '@/utils/store'
 
export function getWebsocketUrl() {
    const token = localStorage.getItem(ELocalStorageKey.Token) || getStore({ name: 'token' }) || ''
    const url = import.meta.env.VITE_APP_WS_API_URL + '?x-auth-token=' + encodeURI(token)
    return url
}
// AI 指令飞行
export function getAIWebsocketUrl() {
    const token = localStorage.getItem(ELocalStorageKey.Token) || ''
    const url = `${import.meta.env.VITE_APP_WS_API_URL}?x-auth-token=${encodeURI(token)}`
    return url
}