mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-20 10:50:48 +08:00
fix: orm 序列化
This commit is contained in:
@@ -8,6 +8,8 @@ using System.Text.Json;
|
||||
using System.Text.Json.Serialization;
|
||||
using System.Text.Json.Serialization.Metadata;
|
||||
|
||||
using ThingsGateway.NewLife.Json.Extension;
|
||||
|
||||
using JsonProperty = Newtonsoft.Json.Serialization.JsonProperty;
|
||||
|
||||
namespace ThingsGateway.SqlSugar
|
||||
@@ -23,8 +25,10 @@ namespace ThingsGateway.SqlSugar
|
||||
|
||||
private static readonly JsonSerializerOptions _systemTextJsonSettings = new()
|
||||
{
|
||||
Encoder = System.Text.Encodings.Web.JavaScriptEncoder.UnsafeRelaxedJsonEscaping,
|
||||
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
|
||||
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull,
|
||||
NumberHandling = JsonNumberHandling.AllowNamedFloatingPointLiterals,
|
||||
};
|
||||
|
||||
private static readonly ConcurrentDictionary<Type, SugarColumn> _typeInfoCache = new();
|
||||
@@ -52,6 +56,11 @@ namespace ThingsGateway.SqlSugar
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
_systemTextJsonSettings.Converters.Add(new JTokenSystemTextJsonConverter());
|
||||
_systemTextJsonSettings.Converters.Add(new JValueSystemTextJsonConverter());
|
||||
_systemTextJsonSettings.Converters.Add(new JObjectSystemTextJsonConverter());
|
||||
_systemTextJsonSettings.Converters.Add(new JArraySystemTextJsonConverter());
|
||||
_systemTextJsonSettings.TypeInfoResolver = resolver;
|
||||
}
|
||||
public static bool UseNewtonsoftJson = false;
|
||||
|
@@ -1,9 +1,9 @@
|
||||
<Project>
|
||||
|
||||
<PropertyGroup>
|
||||
<PluginVersion>10.11.90</PluginVersion>
|
||||
<ProPluginVersion>10.11.90</ProPluginVersion>
|
||||
<DefaultVersion>10.11.90</DefaultVersion>
|
||||
<PluginVersion>10.11.92</PluginVersion>
|
||||
<ProPluginVersion>10.11.92</ProPluginVersion>
|
||||
<DefaultVersion>10.11.92</DefaultVersion>
|
||||
<AuthenticationVersion>10.11.6</AuthenticationVersion>
|
||||
<SourceGeneratorVersion>10.11.6</SourceGeneratorVersion>
|
||||
<NET8Version>8.0.20</NET8Version>
|
||||
|
Reference in New Issue
Block a user