the relay server for openai websocket is ready

This commit is contained in:
RockYang
2024-10-17 16:46:41 +08:00
parent e356771049
commit 43c507c597
13 changed files with 184 additions and 263 deletions

View File

@@ -12,8 +12,6 @@ import {isChrome, isMobile} from "@/utils/libs";
import {showMessageInfo} from "@/utils/dialog";
import {useSharedStore} from "@/store/sharedata";
import {getUserToken} from "@/store/session";
import {router} from "@/router";
import {onBeforeRouteLeave, onBeforeRouteUpdate} from "vue-router";
const debounce = (fn, delay) => {
let timer
@@ -71,7 +69,7 @@ const connect = () => {
}
}
const clientId = getClientId()
const _socket = new WebSocket(host + `/api/ws?client_id=${clientId}&token=${getUserToken()}`);
const _socket = new WebSocket(host + `/api/ws?client_id=${clientId}`,["token",getUserToken()]);
_socket.addEventListener('open', () => {
console.log('WebSocket 已连接')
handler.value = setInterval(() => {