From 2c0d483fc10e554e5376549a53e07b9700efb099 Mon Sep 17 00:00:00 2001 From: sunjuzhong <129019668+sunjuzhong@users.noreply.github.com> Date: Sat, 23 Aug 2025 20:50:51 +0800 Subject: [PATCH] feat: update api --- neo/api.go | 9 ++++++++- widgets/login/process.go | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/neo/api.go b/neo/api.go index 71e866da..af765e56 100644 --- a/neo/api.go +++ b/neo/api.go @@ -232,7 +232,14 @@ func (neo *DSL) handleChat(c *gin.Context) { defer cancel() defer ctx.Release() // Release the context after the request is done - neo.Answer(ctx, content, c) + err := neo.Answer(ctx, content, c) + + // Error handling + if err != nil { + message.New().Done().Error(err).Write(c.Writer) + c.Done() + return + } } // handleChatList handles the chat list request diff --git a/widgets/login/process.go b/widgets/login/process.go index 6dbc32fc..54d70db1 100644 --- a/widgets/login/process.go +++ b/widgets/login/process.go @@ -146,5 +146,6 @@ func auth(field string, value string, password string, sid string) maps.Map { "items": items, }, "studio": studio, + "sid": sid, } }