From 197b303b1d557e55cfb50adf93070f4fca01d2cb Mon Sep 17 00:00:00 2001 From: LoveKicher Date: Wed, 30 Oct 2024 16:25:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=B8=B4=E6=97=B6=E8=A7=A3=E5=86=B3rece?= =?UTF-8?q?ption.content=E5=BA=8F=E5=88=97=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Services/ReceptionExecutorHook.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Services/ReceptionExecutorHook.cs b/Services/ReceptionExecutorHook.cs index fdbc8c1..a4ec637 100644 --- a/Services/ReceptionExecutorHook.cs +++ b/Services/ReceptionExecutorHook.cs @@ -115,7 +115,12 @@ public class ReceptionExecutorHook : ITransient, IPostInsert, IPostReplace, IPos reception["isReject"] = false; Console.WriteLine(JsonConvert.SerializeObject(reception)); - // TODO: reception.extensions["content"] 接收到是JObject,写入后变成了嵌套高维数组 + // HACK: reception.extensions["content"] 接收到是JObject,写入后变成了嵌套高维数组 + if (reception["content"] is JObject or JToken) + { + reception["content"] = (reception["content"] as JToken)?.ToBDocument(); + } + var newReception = await coll.data.FindOneAndReplaceAsync(x => x.id == reception.id, reception, new() { ReturnDocument = ReturnDocument.After, -- Gitee