From 5c8787cc68934eeb395832f9193e1052def1b8c2 Mon Sep 17 00:00:00 2001 From: cKey <35512826+colinin@users.noreply.github.com> Date: Sat, 26 Dec 2020 15:52:25 +0800 Subject: [PATCH] Use Newtonsoft.Json to serialize the Meta field --- .../Platform/PlatformApplicationContractModule.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs index fc629e070..e028e619c 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs @@ -1,4 +1,7 @@ using LINGYUN.Platform.Localization; +using LINGYUN.Platform.Menus; +using System.Collections.Generic; +using Volo.Abp.Json.SystemTextJson; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.VirtualFileSystem; @@ -10,6 +13,13 @@ namespace LINGYUN.Platform { public override void ConfigureServices(ServiceConfigurationContext context) { + Configure(options => + { + // 2020-12-26 对于结构中的 Meta 字段,需要使用 Newtonsoft.Json 来序列化 + options.UnsupportedTypes.AddIfNotContains(typeof(MenuCreateDto)); + options.UnsupportedTypes.AddIfNotContains(typeof(MenuUpdateDto)); + }); + Configure(options => { options.FileSets.AddEmbedded(); @@ -21,7 +31,6 @@ namespace LINGYUN.Platform .Get() .AddVirtualJson("/LINGYUN/Platform/Localization/ApplicationContracts"); }); - } } }