序列化配置增加nan的情况

This commit is contained in:
Diego
2025-05-26 17:41:13 +08:00
parent 6b2e53d6dc
commit d9119ee03d
3 changed files with 7 additions and 5 deletions

View File

@@ -37,7 +37,8 @@ public static class SystemTextJsonExtension
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = true, // 缩进
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull // 忽略 null
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, // 忽略 null
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
};
// 如有自定义Converter这里添加
// IndentedOptions.Converters.Add(new ByteArrayJsonConverter());
@@ -50,7 +51,8 @@ public static class SystemTextJsonExtension
{
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
WriteIndented = false, // 不缩进
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
};
NoneIndentedOptions.Converters.Add(new ByteArrayToNumberArrayConverterSystemTextJson());
NoneIndentedOptions.Converters.Add(new JTokenSystemTextJsonConverter());

View File

@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<PluginVersion>10.6.21</PluginVersion>
<ProPluginVersion>10.6.21</ProPluginVersion>
<PluginVersion>10.6.22</PluginVersion>
<ProPluginVersion>10.6.22</ProPluginVersion>
<AuthenticationVersion>2.1.7</AuthenticationVersion>
</PropertyGroup>

View File

@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>10.6.21</Version>
<Version>10.6.22</Version>
</PropertyGroup>
<ItemGroup>