diff --git a/internal/biz/router.go b/internal/biz/router.go index be1358d..f52a040 100644 --- a/internal/biz/router.go +++ b/internal/biz/router.go @@ -297,7 +297,7 @@ func (r *AiRouterBiz) handleKnowle(channel chan entitys.Response, c *websocket.C } // 通过session 找到知识库session - session := c.Headers("X-Session", "") + session := c.Query("x-session", "") if len(session) == 0 { return errors.SessionNotFound } diff --git a/internal/services/chat.go b/internal/services/chat.go index 36c89e0..7143e7d 100644 --- a/internal/services/chat.go +++ b/internal/services/chat.go @@ -100,7 +100,7 @@ func (h *ChatService) Chat(c *websocket.Conn) { //简单协议:bind: if c.Headers("Sec-Websocket-Protocol") == "bind" && req.SessionID != "" { - uid := c.Headers("X-Session") + uid := c.Query("x-session") _ = h.Gw.BindUid(clientID, req.SessionID) log.Printf("bind %s -> uid:%s\n", clientID, uid) }