Browse Source

Merge pull request #168 from colinin/4.0

Use Newtonsoft.Json to serialize the Meta field
pull/177/head
cKey 5 years ago
committed by GitHub
parent
commit
19edfa72cf
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      aspnet-core/modules/platform/LINGYUN.Platform.Application.Contracts/LINGYUN/Platform/PlatformApplicationContractModule.cs

11
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<AbpSystemTextJsonSerializerOptions>(options =>
{
// 2020-12-26 对于结构中的 Meta 字段,需要使用 Newtonsoft.Json 来序列化
options.UnsupportedTypes.AddIfNotContains(typeof(MenuCreateDto));
options.UnsupportedTypes.AddIfNotContains(typeof(MenuUpdateDto));
});
Configure<AbpVirtualFileSystemOptions>(options =>
{
options.FileSets.AddEmbedded<PlatformApplicationContractModule>();
@ -21,7 +31,6 @@ namespace LINGYUN.Platform
.Get<PlatformResource>()
.AddVirtualJson("/LINGYUN/Platform/Localization/ApplicationContracts");
});
}
}
}

Loading…
Cancel
Save