fix: 修复一个 Json 解析的错误问题

Signed-off-by: huyufei <yufei.hu@castbox.fm>
main
胡宇飞 2024-07-01 20:41:24 +08:00
parent 2075f676b9
commit dc47cec8bd
1 changed files with 4 additions and 1 deletions

View File

@ -52,7 +52,10 @@ namespace Guru
try
{
// return JsonMapper.ToObject<T>(jsonStr);
return JsonConvert.DeserializeObject<T>(jsonStr);
return JsonConvert.DeserializeObject<T>(jsonStr, new JsonSerializerSettings()
{
ObjectCreationHandling = ObjectCreationHandling.Replace,
});
}
catch (Exception e)
{