From 4ec3dc3ad005ddddad159512128f25371dd62af5 Mon Sep 17 00:00:00 2001 From: WangLiZhao <1838393649@qq.com> Date: Mon, 22 Jun 2026 10:31:51 +0800 Subject: [PATCH] =?UTF-8?q?fix(prompt):=20=E4=BF=AE=E5=A4=8DOSS=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E8=A7=A3=E6=9E=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/prompt/prompt_compose_service.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/service/prompt/prompt_compose_service.go b/service/prompt/prompt_compose_service.go index 2d62162..2cc196e 100644 --- a/service/prompt/prompt_compose_service.go +++ b/service/prompt/prompt_compose_service.go @@ -2,6 +2,7 @@ package prompt import ( "context" + "encoding/json" "errors" "fmt" "prompts-core/common/util" @@ -14,7 +15,6 @@ import ( "gitea.redpowerfuture.com/red-future/common/beans" "gitea.redpowerfuture.com/red-future/common/utils" - "github.com/gogf/gf/v2/encoding/gjson" "github.com/gogf/gf/v2/frame/g" "github.com/gogf/gf/v2/util/gconv" ) @@ -154,7 +154,9 @@ func Callback(ctx context.Context, req *dto.CallbackReq) error { // 3) 解析 OSS 内容为消息 var messages map[string]any if len(ossContent) > 0 { - messages = gjson.New(ossContent).Map() + if err := json.Unmarshal(ossContent, &messages); err != nil { + g.Log().Warningf(ctx, "[回调处理] 解析OSS内容失败 taskId=%s err=%v", req.TaskId, err) + } } // 4) 处理失败