* fix: correct websocket header

* fix: correct websocket header
This commit is contained in:
Medcl
2025-01-06 00:06:04 +08:00
committed by GitHub
parent 43c940207c
commit aafa792d15
2 changed files with 2 additions and 2 deletions

View File

@@ -54,7 +54,7 @@ const ChatAI = forwardRef<ChatAIRef, ChatAIProps>(
"ws://localhost:2900/ws", "ws://localhost:2900/ws",
(msg) => { (msg) => {
console.log("msg", msg); console.log("msg", msg);
if (msg.includes("WEBSOCKET-SESSION-ID")) { if (msg.includes("websocket-session-id")) {
const array = msg.split(" "); const array = msg.split(" ");
setWebsocketId(array[2]); setWebsocketId(array[2]);
} }

View File

@@ -35,7 +35,7 @@ export default function ChatAI({}: ChatAIProps) {
const { messages, setMessages } = useWebSocket( const { messages, setMessages } = useWebSocket(
"ws://localhost:2900/ws", "ws://localhost:2900/ws",
(msg) => { (msg) => {
if (msg.includes("WEBSOCKET-SESSION-ID")) { if (msg.includes("websocket-session-id")) {
const array = msg.split(" "); const array = msg.split(" ");
setWebsocketId(array[2]); setWebsocketId(array[2]);
} }