Browse Source

chore: Update abp framework to 10.4.0

pull/1505/head
colin 3 months ago
parent
commit
0d04733a1c
  1. 76
      .changes/Migration 10.2.0 - 10.4.0.md
  2. 46
      Directory.Packages.props
  3. 10
      apps/vben5/apps/app-antd/src/layouts/basic.vue
  4. 20
      apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue
  5. 51
      apps/vben5/packages/@abp/tasks/src/components/job-infos/JobInfoDrawer.vue
  6. 18
      apps/vben5/packages/@abp/tasks/src/components/job-infos/JobInfoTable.vue
  7. 10
      apps/vben5/packages/@abp/tasks/src/types/job-infos.ts
  8. 13
      apps/vben5/packages/@abp/ui/src/components/properties/PropertyTable.vue
  9. 1
      apps/vben5/packages/@abp/ui/src/components/properties/types.ts
  10. 15
      apps/vben5/packages/@abp/wechat/src/components/bind-user/index.vue
  11. 2
      apps/vben5/packages/@abp/wechat/src/constants/features.ts
  12. 1
      aspnet-core/LINGYUN.MicroService.All.slnx
  13. 8
      aspnet-core/LINGYUN.MicroService.Aspire.slnx
  14. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AIService/AIServiceModule.cs
  15. 3
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AIService/appsettings.Development.json
  16. 3
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDataSeeder.cs
  17. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AdminService/appsettings.Development.json
  18. 30
      aspnet-core/aspire/LINGYUN.Abp.MicroService.ApiGateway/yarp.json
  19. 19
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs
  20. 8
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs
  21. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/appsettings.Development.json
  22. 8
      aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/package.json
  23. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.IdentityService/appsettings.Development.json
  24. 8
      aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/LocalizationServiceModule.Configure.cs
  25. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/LocalizationServiceModule.cs
  26. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/appsettings.Development.json
  27. 120
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs
  28. 10
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDataSeedConsts.cs
  29. 33
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDataSeeder.cs
  30. 64
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDbMigrationEventHandler.cs
  31. 10
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDbMigrationService.cs
  32. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/appsettings.Development.json
  33. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/LINGYUN.Abp.MicroService.PlatformService.csproj
  34. 2
      aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/PlatformServiceModule.cs
  35. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/appsettings.Development.json
  36. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/appsettings.Development.json
  37. 4
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WeChatService/WeChatServiceModule.Configure.cs
  38. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WeChatService/appsettings.Development.json
  39. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/appsettings.Development.json
  40. 1
      aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json
  41. 121
      aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs
  42. 20
      aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN/Abp/Telemetry/OpenTelemetry/AbpTelemetryOpenTelemetryModule.cs
  43. 12
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs
  44. 8
      aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs
  45. 3
      aspnet-core/migrate-database.bat
  46. 8
      aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/OpenIddictDataSeederContributor.cs
  47. 8
      aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs
  48. 18
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionUserInactiveSynchronizer.cs
  49. 2
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserDeactivationNotifier.tpl
  50. 2
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserDeletionNotifier.tpl
  51. 2
      aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserReminderNotifier.tpl
  52. 24
      aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider.cs
  53. 4
      aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs
  54. 1
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs
  55. 2
      aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs
  56. 253
      aspnet-core/services/LY.MicroService.Applications.Single/Settings/SystemGroupSettingDefinitionProvider.cs
  57. 34
      aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json
  58. 260
      aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Settings/SystemGroupSettingDefinitionProvider.cs
  59. 2
      aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj
  60. 2
      aspnet-core/tests/LINGYUN.Abp.BlobStoring.Nexus.Tests/LINGYUN.Abp.BlobStoring.Nexus.Tests.csproj
  61. 2
      aspnet-core/tests/LINGYUN.Abp.DataProtection.Tests/LINGYUN.Abp.DataProtection.Tests.csproj
  62. 2
      aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj
  63. 2
      aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj
  64. 2
      aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj
  65. 2
      aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj
  66. 2
      aspnet-core/tests/LINGYUN.Abp.IdGenerator.Tests/LINGYUN.Abp.IdGenerator.Tests.csproj
  67. 2
      aspnet-core/tests/LINGYUN.Abp.Localization.Xml.Tests/LINGYUN.Abp.Localization.Xml.Tests.csproj
  68. 2
      aspnet-core/tests/LINGYUN.Abp.Location.Baidu.Tests/LINGYUN.Abp.Location.Baidu.Tests.csproj
  69. 2
      aspnet-core/tests/LINGYUN.Abp.Location.Tencent.Tests/LINGYUN.Abp.Location.Tencent.Tests.csproj
  70. 2
      aspnet-core/tests/LINGYUN.Abp.Rules.RulesEngine.Tests/LINGYUN.Abp.Rules.RulesEngine.Tests.csproj
  71. 2
      aspnet-core/tests/LINGYUN.Abp.WeChat.Work.Tests/LINGYUN.Abp.WeChat.Work.Tests.csproj

76
.changes/Migration 10.2.0 - 10.4.0.md

@ -0,0 +1,76 @@
# 10.2.0 - 10.4.0
## 模块变更
1. [身份标识模块] 增加不活跃用户通知/清理作业,实现了三个通知模板(账户保持活跃通知、账户停用通知、账户删除通知)
2. [身份标识模块] 增加不活跃用户实体 `IdentityUserInactive` 需要执行数据库迁移
3. [身份标识模块] 增加用户登录Url设置定义: `Abp.Identity.Link.UserLoginUri`, 用于在外部系统中关联用户登录页
4. [身份认证模块] 增加用户登录Url定义: `Abp.Account.UserLogin`
5. [身份认证模块] 增加关联用户登录功能, 可以实现跨租户用户关联, 切换关联用户登录
6. [设置管理模块] 增加身份标识模块缺少的设置项: 启用防止密码重用、防止密码重用数量
7. [设置基础模块] 增加设置定义分组、所属设置、优先级、依赖权限、依赖功能、选择项等常用结构扩展
8. [设置管理模块] 重构设置管理应用服务接口, 通过预设定的设置定义分组、上下级关系等自动构成Dto结构
## 依赖项变更
| 库名称 | 原版本 | 现版本 |
| -------------------------------------------- | --------- | ------ |
| Microsoft.AspNetCore.* | 10.0.2 | 10.0.7 |
| Microsoft.Bcl.AsyncInterfaces | 10.0.2 | 10.0.7 |
| Microsoft.Data.Sqlite.Core | 10.0.0 | 10.0.7 |
| Microsoft.EntityFrameworkCore.* | 10.0.2 | 10.0.7 |
| Microting.EntityFrameworkCore.MySql | 10.0.3 | 10.0.7 |
| Microsoft.Extensions.* | 10.0.2 | 10.0.7 |
| OpenTelemetry.Extensions.Hosting | 1.14.0 | 1.15.3 |
| OpenTelemetry.Exporter.Console | 1.14.0 | 1.15.3 |
| OpenTelemetry.Exporter.OpenTelemetryProtocol | 1.14.0 | 1.15.3 |
| OpenTelemetry.Exporter.Zipkin | 1.14.0 | 1.15.3 |
| OpenTelemetry.Instrumentation.AspNetCore | 1.14.0 | 1.15.2 |
| OpenTelemetry.Instrumentation.Http | 1.14.0 | 1.15.1 |
| OpenTelemetry.Instrumentation.Quartz | 1.14.0-beta.2 | 1.15.1-beta.1 |
| OpenTelemetry.Instrumentation.Runtime | 1.14.0 | 1.15.1 |
| OpenTelemetry.Instrumentation.SqlClient | 1.14.0-beta.1 | 1.15.2 |
| OpenIddict.Server.DataProtection | 7.2.0 | 7.5.0 |
| OpenIddict.Validation.DataProtection | 7.2.0 | 7.5.0 |
| System.Threading.Channels | 10.0.0 | 10.0.7 |
| Volo.Abp.* | 10.2.0 | 10.4.0 |
| Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite | 5.2.0 | 5.4.0 |
## 数据库迁移
| Project Name | Database Provider | Scripts | EF Core Version |
| ------------------------ | ----------------- | ---------------------------------------------- | --------------- |
| aspire/AuthServer | PostgreSQL | 20260530060327_Add-Identity-User-Inactive | 10.0.2 |
| services/Single | MySQL | 20260529063257_Add-Identity-User-Inactive | 10.0.3 |
| services/Single | PostgreSQL | 20260530055941_Add-Identity-User-Inactive | 10.0.2 |
| services/Single | SqlServer | 20260530060009_Add-Identity-User-Inactive | 10.0.2 |
| services/AuthServer | MySQL | 20260530061141_Add-Identity-User-Inactive | 10.0.3 |
## 数据库连接字符串
| Module Name | ConnectionString Name | Example(MySQL) |
| ----------------------------- | ---------------------------- | ------------------------------------------------------------ |
| Default | Default | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/Identity | AbpIdentity | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/IdentityServer | AbpIdentityServer | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/OpenIddict | AbpOpenIddict | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/TenantManagement | AbpTenantManagement(AbpSaas) | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/FeatureManagement | AbpFeatureManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/SettingManagement | AbpSettingManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| abp/PermissionManagement | AbpPermissionManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/AIManagement | AbpAIManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/BlobManagement | AbpBlobManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/DataProtectionManagement | AbpDataProtectionManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/Gdpr | AbpGdpr | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/Saas | AbpSaas | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/LocalizationManagement | AbpLocalizationManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/TextTemplating | AbpTextTemplating | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/Platform | AppPlatform | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/MessageService | MessageService | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/NotificationService | Notifications | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/TaskManagement | TaskManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/WebhooksManagement | WebhooksManagement | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |
| labp/Elsa | Workflow | Server=127.0.0.1;Database=abp;User Id=root;Password=123456;SslMode=None |

46
Directory.Packages.props

@ -3,17 +3,17 @@
<DotNetCoreCAPPackageVersion>10.0.0</DotNetCoreCAPPackageVersion>
<ElsaPackageVersion>2.16.1</ElsaPackageVersion>
<ElsaNextPackageVersion>3.6.0</ElsaNextPackageVersion>
<VoloAbpPackageVersion>10.2.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>10.2.0</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>10.0.2</MicrosoftExtensionsPackageVersion>
<MicrosoftAspNetCorePackageVersion>10.0.2</MicrosoftAspNetCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>10.0.2</MicrosoftEntityFrameworkCorePackageVersion>
<VoloAbpPackageVersion>10.4.0</VoloAbpPackageVersion>
<LINGYUNAbpPackageVersion>10.4.0</LINGYUNAbpPackageVersion>
<MicrosoftExtensionsPackageVersion>10.0.7</MicrosoftExtensionsPackageVersion>
<MicrosoftAspNetCorePackageVersion>10.0.7</MicrosoftAspNetCorePackageVersion>
<MicrosoftEntityFrameworkCorePackageVersion>10.0.7</MicrosoftEntityFrameworkCorePackageVersion>
<AspirePackageVersion>13.1.0</AspirePackageVersion>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Abp Framework -->
<ItemGroup>
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="5.2.0" />
<PackageVersion Include="Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonXLite" Version="5.4.0" />
<PackageVersion Include="Volo.Abp.AI" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Core" Version="$(VoloAbpPackageVersion)" />
<PackageVersion Include="Volo.Abp.Account.Application" Version="$(VoloAbpPackageVersion)" />
@ -164,7 +164,7 @@
<PackageVersion Include="Microsoft.AspNetCore.SignalR.Protocols.Json" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="$(MicrosoftAspNetCorePackageVersion)" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.2" />
<PackageVersion Include="Microsoft.Bcl.AsyncInterfaces" Version="10.0.7" />
<PackageVersion Include="Microsoft.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.Design" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" />
<PackageVersion Include="Microsoft.EntityFrameworkCore.InMemory" Version="$(MicrosoftEntityFrameworkCorePackageVersion)" />
@ -186,11 +186,11 @@
<PackageVersion Include="MySql.EntityFrameworkCore" Version="10.0.1" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql" Version="9.0.0" />
<PackageVersion Include="Pomelo.EntityFrameworkCore.MySql.Json.Microsoft" Version="9.0.0" />
<PackageVersion Include="Microting.EntityFrameworkCore.MySql" Version="10.0.3" />
<PackageVersion Include="Microting.EntityFrameworkCore.MySql" Version="10.0.7" />
</ItemGroup>
<!-- Aspire -->
<ItemGroup>
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="13.0.0" />
<PackageVersion Include="Aspire.Hosting.Elasticsearch" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.Hosting.JavaScript" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.Hosting.MySql" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.Hosting.PostgreSQL" Version="$(AspirePackageVersion)" />
@ -200,7 +200,7 @@
<PackageVersion Include="Aspire.Pomelo.EntityFrameworkCore.MySql" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.StackExchange.Redis" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.RabbitMQ.Client" Version="$(AspirePackageVersion)" />
<PackageVersion Include="Aspire.Elastic.Clients.Elasticsearch" Version="13.0.0" />
<PackageVersion Include="Aspire.Elastic.Clients.Elasticsearch" Version="$(AspirePackageVersion)" />
</ItemGroup>
<!-- Elsa -->
<ItemGroup>
@ -276,16 +276,16 @@
</ItemGroup>
<!-- OpenTelemetry -->
<ItemGroup>
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Extensions.Hosting" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Exporter.Console" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Exporter.Zipkin" Version="1.15.3" />
<PackageVersion Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.15.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Http" Version="1.15.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.EntityFrameworkCore" Version="1.14.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Quartz" Version="1.14.0-beta.2" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.14.0" />
<PackageVersion Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.14.0-beta.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Quartz" Version="1.15.1-beta.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.Runtime" Version="1.15.1" />
<PackageVersion Include="OpenTelemetry.Instrumentation.SqlClient" Version="1.15.2" />
</ItemGroup>
<!-- AI -->
<ItemGroup>
@ -318,7 +318,7 @@
<PackageVersion Include="Oracle.ManagedDataAccess.Core" Version="23.6.1" />
<PackageVersion Include="Npgsql" Version="10.0.0" />
<PackageVersion Include="Microsoft.Data.SqlClient" Version="6.1.1" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.0" />
<PackageVersion Include="Microsoft.Data.Sqlite.Core" Version="10.0.7" />
</ItemGroup>
<!-- Other -->
<ItemGroup>
@ -365,8 +365,8 @@
<PackageVersion Include="OllamaSharp" Version="5.4.20" />
<PackageVersion Include="ModelContextProtocol" Version="1.1.0" />
<PackageVersion Include="Microsoft.SemanticKernel.Connectors.Ollama" Version="1.74.0-alpha" />
<PackageVersion Include="OpenIddict.Server.DataProtection" Version="7.2.0" />
<PackageVersion Include="OpenIddict.Validation.DataProtection" Version="7.2.0" />
<PackageVersion Include="OpenIddict.Server.DataProtection" Version="7.5.0" />
<PackageVersion Include="OpenIddict.Validation.DataProtection" Version="7.5.0" />
<PackageVersion Include="Polly" Version="8.6.3" />
<PackageVersion Include="QRCoder" Version="1.5.1" />
<PackageVersion Include="Quartz.Serialization.Json" Version="3.15.0" />
@ -383,7 +383,7 @@
<PackageVersion Include="Spire.XLS" Version="15.12.0" />
<PackageVersion Include="Swashbuckle.AspNetCore" Version="10.0.1" />
<PackageVersion Include="System.ComponentModel.Annotations" Version="5.0.0" />
<PackageVersion Include="System.Threading.Channels" Version="10.0.0" />
<PackageVersion Include="System.Threading.Channels" Version="10.0.7" />
<PackageVersion Include="Tencent.QCloud.Cos.Sdk" Version="5.4.37" />
<PackageVersion Include="TencentCloudSDK" Version="3.0.1273" />
<PackageVersion Include="Yarp.ReverseProxy" Version="2.3.0" />

10
apps/vben5/apps/app-antd/src/layouts/basic.vue

@ -14,7 +14,7 @@ import {
UserDropdown,
} from '@vben/layouts';
import { preferences } from '@vben/preferences';
import { useAccessStore, useUserStore } from '@vben/stores';
import { useAccessStore, useTabbarStore, useUserStore } from '@vben/stores';
import { useAbpStore } from '@abp/core';
@ -30,11 +30,12 @@ const notifications = ref<NotificationItem[]>([]);
useSessions();
const { replace } = useRouter();
const router = useRouter();
const abpStore = useAbpStore();
const userStore = useUserStore();
const authStore = useAuthStore();
const accessStore = useAccessStore();
const tabbarStore = useTabbarStore();
const { destroyWatermark, updateWatermark } = useWatermark();
const showDot = computed(() =>
notifications.value.some((item) => !item.isRead),
@ -57,7 +58,7 @@ const menus = computed(() => [
},
{
handler: () => {
replace('/account/my-settings');
router.replace('/account/my-settings');
},
icon: UserSettingsIcon,
text: $t('abp.account.settings.title'),
@ -109,7 +110,8 @@ async function handleLinkUser(token: string) {
async function handleLinkLogin(userId: string, tenantId?: string) {
await authStore.linkUseLogin(userId, tenantId, () => {
window.location.reload();
tabbarStore.closeAllTabs(router);
window.location.replace('/');
});
}
watch(

20
apps/vben5/packages/@abp/settings/src/components/settings/SettingForm.vue

@ -41,7 +41,6 @@ const emits = defineEmits<{
const FormItem = Form.Item;
const TabPane = Tabs.TabPane;
const CollapsePanel = Collapse.Panel;
const SelectOption = Select.Option;
const defaultModel: SettingsUpdateInput = {
settings: [],
@ -104,6 +103,15 @@ function onValueChange(setting: SettingDetail) {
}
}
function onFilterOption(input: string, option: any) {
if (option?.value || option?.name) {
return (
option?.name?.toLowerCase().includes(input.toLowerCase()) ||
option?.value?.toLowerCase().includes(input.toLowerCase())
);
}
}
onMounted(onGet);
</script>
@ -190,16 +198,20 @@ onMounted(onGet);
<Select
v-if="detail.valueType === ValueType.Option"
v-model:value="detail.value"
:filter-option="onFilterOption"
:field-names="{ label: 'name', value: 'value' }"
:options="detail.options"
show-search
@change="onValueChange(detail)"
>
<SelectOption
/>
<!-- <SelectOption
v-for="option in detail.options"
:key="option.value"
:disabled="option.value === detail.value"
>
{{ option.name }}
</SelectOption>
</Select>
</Select> -->
<Checkbox
v-if="detail.valueType === ValueType.Boolean"
:checked="detail.value?.toLowerCase() === 'true'"

51
apps/vben5/packages/@abp/tasks/src/components/job-infos/JobInfoDrawer.vue

@ -27,7 +27,7 @@ import {
} from 'ant-design-vue';
import { useJobInfosApi } from '../../api/useJobInfosApi';
import { JobPriority, JobType } from '../../types/job-infos';
import { JobPriority, JobSource, JobType } from '../../types/job-infos';
defineOptions({
name: 'JobInfoDrawer',
@ -40,6 +40,9 @@ interface JobParamter {
key: string;
value: any;
}
interface ModalState extends BackgroundJobInfoDto {
isCopy?: boolean;
}
const activedTab = ref('basic');
const jobTypeOptions = reactive([
@ -79,6 +82,7 @@ const jobPriorityOptions = reactive([
},
]);
const jobDefinetions = ref<BackgroundJobDefinitionDto[]>([]);
const jobArgsDisplayNameMap = ref<Record<string, string>>({});
const form = useTemplateRef<FormInstance>('form');
const formModel = ref<BackgroundJobInfoDto>({} as BackgroundJobInfoDto);
const { createApi, getApi, getDefinitionsApi, updateApi } = useJobInfosApi();
@ -101,9 +105,9 @@ const [Drawer, drawerApi] = useVbenDrawer({
priority: JobPriority.Normal,
} as BackgroundJobInfoDto;
drawerApi.setState({ loading: true });
const dto = drawerApi.getData<BackgroundJobInfoDto>();
if (dto?.id) {
await onGet(dto.id);
const state = drawerApi.getData<ModalState>();
if (state?.id) {
await onGet(state.id, state.isCopy);
} else {
await onInitDefaultJobs();
drawerApi.setState({
@ -117,12 +121,23 @@ const [Drawer, drawerApi] = useVbenDrawer({
},
title: $t('BackgroundJobs:Edit'),
});
async function onGet(id: string) {
async function onGet(id: string, isCopy?: boolean) {
const dto = await getApi(id);
if (isCopy === true) {
dto.id = '';
dto.name = '';
dto.source = JobSource.User;
drawerApi.setState({
title: $t('TaskManagement.BackgroundJobs:AddNew'),
});
await onInitDefaultJobs();
} else {
drawerApi.setState({
title: `${$t('TaskManagement.BackgroundJobs:Edit')} - ${dto.name}`,
});
}
formModel.value = dto;
drawerApi.setState({
title: `${$t('TaskManagement.BackgroundJobs:Edit')} - ${dto.name}`,
});
}
async function onInitDefaultJobs() {
@ -148,14 +163,18 @@ async function onSubmit() {
function onJobDefineChange(jobName: string) {
formModel.value.args = {};
jobArgsDisplayNameMap.value = {};
const jobDefine = jobDefinetions.value.find((x) => x.name === jobName);
if (jobDefine) {
const params: Record<string, any> = {};
const paramDisplayNames: Record<string, any> = {};
jobDefine.paramters.forEach((param) => {
params[param.name] = undefined;
paramDisplayNames[param.name] = param.displayName;
});
formModel.value.args = params;
formModel.value.type = jobDefine.name;
jobArgsDisplayNameMap.value = paramDisplayNames;
}
}
@ -206,6 +225,7 @@ function onDeleteParam(record: JobParamter) {
>
<Input
v-model:value="formModel.nodeName"
:disabled="!!formModel.id"
allow-clear
autocomplete="off"
/>
@ -217,6 +237,7 @@ function onDeleteParam(record: JobParamter) {
>
<Input
v-model:value="formModel.group"
:disabled="!!formModel.id"
allow-clear
autocomplete="off"
/>
@ -228,6 +249,7 @@ function onDeleteParam(record: JobParamter) {
>
<Input
v-model:value="formModel.name"
:disabled="!!formModel.id"
allow-clear
autocomplete="off"
/>
@ -241,6 +263,7 @@ function onDeleteParam(record: JobParamter) {
<Textarea
allow-clear
v-model:value="formModel.type"
:disabled="!!formModel.id"
:auto-size="{ minRows: 3 }"
/>
</FormItem>
@ -280,7 +303,16 @@ function onDeleteParam(record: JobParamter) {
/>
</FormItem>
<FormItem
v-if="formModel.jobType === JobType.Period"
v-if="formModel.jobType === JobType.Persistent"
name="interval"
required
:label="$t('TaskManagement.DisplayName:Interval')"
:extra="$t('TaskManagement.Description:Interval')"
>
<InputNumber class="w-full" v-model:value="formModel.interval" />
</FormItem>
<FormItem
v-else-if="formModel.jobType === JobType.Period"
name="cron"
required
:label="$t('TaskManagement.DisplayName:Cron')"
@ -347,6 +379,7 @@ function onDeleteParam(record: JobParamter) {
<TabPane key="paramters" :tab="$t('TaskManagement.Paramters')">
<PropertyTable
:data="formModel.args"
:display-name-map="jobArgsDisplayNameMap"
@change="onEditParam"
@delete="onDeleteParam"
/>

18
apps/vben5/packages/@abp/tasks/src/components/job-infos/JobInfoTable.vue

@ -16,6 +16,7 @@ import { $t } from '@vben/locales';
import { formatToDateTime } from '@abp/core';
import { useVbenVxeGrid } from '@abp/ui';
import {
CopyOutlined,
DeleteOutlined,
EditOutlined,
EllipsisOutlined,
@ -25,6 +26,7 @@ import {
Button,
Dropdown,
Menu,
MenuDivider,
MenuItem,
message,
Modal,
@ -515,6 +517,14 @@ function onBulkStart() {
function onMenuClick(row: BackgroundJobInfoDto, info: MenuInfo) {
switch (info.key) {
case 'copy': {
jobDrawerApi.setData({
...row,
isCopy: true,
});
jobDrawerApi.open();
break;
}
case 'pause': {
onJobStatusChange(
row,
@ -722,6 +732,14 @@ function onJobStatusChange(
>
{{ $t('TaskManagement.BackgroundJobs:Stop') }}
</MenuItem>
<MenuDivider />
<MenuItem
v-if="hasAccessByCodes([BackgroundJobsPermissions.Create])"
key="copy"
:icon="h(CopyOutlined)"
>
{{ $t('TaskManagement.BackgroundJobs:Copy') }}
</MenuItem>
</Menu>
</template>
<Button :icon="h(EllipsisOutlined)" type="link" />

10
apps/vben5/packages/@abp/tasks/src/types/job-infos.ts

@ -35,8 +35,7 @@ enum JobSource {
}
interface BackgroundJobInfoDto
extends ExtensibleAuditedEntityDto<string>,
IHasConcurrencyStamp {
extends ExtensibleAuditedEntityDto<string>, IHasConcurrencyStamp {
args: Record<string, any>;
beginTime: string;
cron?: string;
@ -53,6 +52,7 @@ interface BackgroundJobInfoDto
maxTryCount: number;
name: string;
nextRunTime?: string;
nodeName?: string;
priority: JobPriority;
result?: string;
source: JobSource;
@ -75,8 +75,7 @@ interface BackgroundJobInfoCreateOrUpdateDto {
priority: JobPriority;
}
interface BackgroundJobInfoCreateDto
extends BackgroundJobInfoCreateOrUpdateDto {
interface BackgroundJobInfoCreateDto extends BackgroundJobInfoCreateOrUpdateDto {
beginTime: string;
endTime?: string;
group: string;
@ -87,8 +86,7 @@ interface BackgroundJobInfoCreateDto
}
interface BackgroundJobInfoUpdateDto
extends BackgroundJobInfoCreateOrUpdateDto,
IHasConcurrencyStamp {}
extends BackgroundJobInfoCreateOrUpdateDto, IHasConcurrencyStamp {}
interface BackgroundJobInfoGetListInput extends PagedAndSortedResultRequestDto {
beginCreationTime?: Date;

13
apps/vben5/packages/@abp/ui/src/components/properties/PropertyTable.vue

@ -46,7 +46,7 @@ const getTableColumns = computed((): TableColumnsType<PropertyInfo> => {
{
align: 'left',
dataIndex: 'key',
width: 100,
width: 150,
title: $t('component.extra_property_dictionary.key'),
customRender: (opt) => {
if (props.renderKey && isFunction(props.renderKey)) {
@ -121,7 +121,16 @@ function onChange(prop: Record<string, string>) {
<div class="justify-center">
<Table bordered :columns="getTableColumns" :data-source="getDataResource">
<template #bodyCell="{ record, column }">
<template v-if="column.dataIndex === 'action'">
<template v-if="column.dataIndex === 'key'">
<div class="flex flex-col">
<span>{{ record.key }}</span>
<span
v-if="props.displayNameMap && props.displayNameMap[record.key]"
>{{ props.displayNameMap[record.key] }}
</span>
</div>
</template>
<template v-else-if="column.dataIndex === 'action'">
<div class="flex flex-row">
<Button
v-if="!props.disabled && props.allowEdit"

1
apps/vben5/packages/@abp/ui/src/components/properties/types.ts

@ -11,6 +11,7 @@ interface PropertyProps {
allowEdit?: boolean;
data?: Dictionary<string, string>;
disabled?: boolean;
displayNameMap?: Dictionary<string, string>;
renderKey?: (key: string) => string | VNode;
}

15
apps/vben5/packages/@abp/wechat/src/components/bind-user/index.vue

@ -3,11 +3,13 @@ import { useTemplateRef } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { buildUUID } from '@abp/core';
import { buildUUID, useFeatures } from '@abp/core';
import { WWLoginRedirectType, WWLoginType } from '@wecom/jssdk';
import * as ww from '@wecom/jssdk';
import { Empty } from 'ant-design-vue';
import { userWorkWeixinJsSdkApi } from '../../api/userWorkWeixinJsSdkApi';
import { WeixinWorkAuthEnable } from '../../constants/features';
const emits = defineEmits<{
/**
@ -18,6 +20,7 @@ const emits = defineEmits<{
}>();
const wxLoginRef = useTemplateRef<Element>('wxLogin');
const { isEnabled } = useFeatures();
const { getAgentConfigApi } = userWorkWeixinJsSdkApi();
const [Modal, modalApi] = useVbenModal({
@ -54,7 +57,15 @@ async function onInitLogin() {
<template>
<Modal :title="$t('AbpAccountOAuth.OAuth:WorkWeixin')">
<div ref="wxLogin"></div>
<div v-if="isEnabled([WeixinWorkAuthEnable])" ref="wxLogin"></div>
<Empty
v-else
:description="
$t('AbpFeature.Volo.Feature:010001', [
$t('AbpAccountOAuth.Features:WeComOAuthEnable'),
])
"
/>
</Modal>
</template>

2
apps/vben5/packages/@abp/wechat/src/constants/features.ts

@ -0,0 +1,2 @@
/** 启用企业微信认证 */
export const WeixinWorkAuthEnable = 'Abp.Account.OAuth.WeCom.Enable';

1
aspnet-core/LINGYUN.MicroService.All.slnx

@ -8,6 +8,7 @@
</Folder>
<Folder Name="/.changes/">
<File Path="../.changes/Migration 10.0.2 - 10.2.0.md" />
<File Path="../.changes/Migration 10.2.0 - 10.4.0.md" />
</Folder>
<Folder Name="/.github/" />
<Folder Name="/.github/workflows/">

8
aspnet-core/LINGYUN.MicroService.Aspire.slnx

@ -1,6 +1,7 @@
<Solution>
<Folder Name="/.changes/">
<File Path="../.changes/Migration 10.0.2 - 10.2.0.md" />
<File Path="../.changes/Migration 10.2.0 - 10.4.0.md" />
</Folder>
<Folder Name="/.github/" />
<Folder Name="/.github/workflows/">
@ -318,7 +319,9 @@
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.FileSystem/LINGYUN.Abp.BlobManagement.FileSystem.csproj" Id="2269c845-fb79-4dde-855d-068bd0df4edf" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.HttpApi.Client/LINGYUN.Abp.BlobManagement.HttpApi.Client.csproj" Id="94f8b5c9-fcd1-46bc-a521-c794c767da3c" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.HttpApi/LINGYUN.Abp.BlobManagement.HttpApi.csproj" Id="88222f2c-d55f-4d31-9776-e76f880ac052" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.MimeCheck/LINGYUN.Abp.BlobManagement.MimeCheck.csproj" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.Minio/LINGYUN.Abp.BlobManagement.Minio.csproj" Id="808fb513-aa95-4645-aea9-07634e6c3a86" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.SettingManagement/LINGYUN.Abp.BlobManagement.SettingManagement.csproj" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobManagement.Tencent/LINGYUN.Abp.BlobManagement.Tencent.csproj" Id="5d99850b-f8ad-4fa0-bcd4-7f5f455ec5d5" />
<Project Path="modules/blob-management/LINGYUN.Abp.BlobStoring.BlobManagement/LINGYUN.Abp.BlobStoring.BlobManagement.csproj" Id="55898e62-9dbe-4569-b7af-b65773408ec5" />
</Folder>
@ -459,6 +462,9 @@
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.HttpApi/LINGYUN.Abp.Notifications.HttpApi.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.SignalR/LINGYUN.Abp.Notifications.SignalR.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.Sms/LINGYUN.Abp.Notifications.Sms.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.Templating/LINGYUN.Abp.Notifications.Templating.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook.WeChat.Work/LINGYUN.Abp.Notifications.Webhook.WeChat.Work.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications.Webhook/LINGYUN.Abp.Notifications.Webhook.csproj" />
<Project Path="modules/realtime-notifications/LINGYUN.Abp.Notifications/LINGYUN.Abp.Notifications.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.Notifications.Jobs/LINGYUN.Abp.Notifications.Jobs.csproj" />
</Folder>
@ -495,6 +501,7 @@
<Project Path="modules/task-management/LINGYUN.Abp.BackgroundTasks.Notifications/LINGYUN.Abp.BackgroundTasks.Notifications.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.BackgroundTasks.Quartz/LINGYUN.Abp.BackgroundTasks.Quartz.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.BackgroundTasks.TaskManagement/LINGYUN.Abp.BackgroundTasks.TaskManagement.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.BackgroundTasks/LINGYUN.Abp.BackgroundTasks.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.Elasticsearch.Jobs/LINGYUN.Abp.Elasticsearch.Jobs.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.Identity.Jobs/LINGYUN.Abp.Identity.Jobs.csproj" />
<Project Path="modules/task-management/LINGYUN.Abp.Quartz.MySqlInstaller/LINGYUN.Abp.Quartz.MySqlInstaller.csproj" />
@ -572,6 +579,7 @@
<Project Path="tests/LINGYUN.Abp.Rules.RulesEngine.Tests/LINGYUN.Abp.Rules.RulesEngine.Tests.csproj" />
<Project Path="tests/LINGYUN.Abp.Sms.Platform.Tests/LINGYUN.Abp.Sms.Platform.Tests.csproj" />
<Project Path="tests/LINGYUN.Abp.TestBase/LINGYUN.Abp.TestsBase.csproj" />
<Project Path="tests/LINGYUN.Abp.WeChat.Common.Tests/LINGYUN.Abp.WeChat.Common.Tests.csproj" Id="8caa0c21-3cd4-4593-af38-e045113fcd75" />
<Project Path="tests/LINGYUN.Abp.WeChat.Work.Tests/LINGYUN.Abp.WeChat.Work.Tests.csproj" />
</Folder>
</Solution>

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.AIService/AIServiceModule.cs

@ -14,6 +14,7 @@ using LINGYUN.Abp.EventBus.CAP;
using LINGYUN.Abp.ExceptionHandling.Emailing;
using LINGYUN.Abp.Identity.Session.AspNetCore;
using LINGYUN.Abp.Localization.CultureMap;
using LINGYUN.Abp.LocalizationManagement.EntityFrameworkCore;
using LINGYUN.Abp.Logging.Serilog.Elasticsearch;
using LINGYUN.Abp.Serilog.Enrichers.Application;
using LINGYUN.Abp.Serilog.Enrichers.UniqueId;
@ -57,6 +58,7 @@ namespace LINGYUN.Abp.MicroService.AIService;
typeof(AbpAIManagementApplicationModule),
typeof(AbpAIManagementHttpApiModule),
typeof(AIServiceMigrationsEntityFrameworkCoreModule),
typeof(AbpLocalizationManagementEntityFrameworkCoreModule),
typeof(AbpDataDbMigratorModule),
typeof(AbpAspNetCoreAuthenticationJwtBearerModule),
typeof(AbpEmailingExceptionHandlingModule),

3
aspnet-core/aspire/LINGYUN.Abp.MicroService.AIService/appsettings.Development.json

@ -35,7 +35,8 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"TableNamePrefix": "admin",
"Schema": "ai",
"TableNamePrefix": "ai",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},
"RabbitMQ": {

3
aspnet-core/aspire/LINGYUN.Abp.MicroService.AdminService.EntityFrameworkCore/AdminServiceDataSeeder.cs

@ -7,6 +7,7 @@ using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.PermissionManagement;
using Volo.Abp.Roles;
namespace LINGYUN.Abp.MicroService.AdminService;
public class AdminServiceDataSeeder : ITransientDependency
@ -49,7 +50,7 @@ public class AdminServiceDataSeeder : ITransientDependency
await PermissionDataSeeder.SeedAsync(
RolePermissionValueProvider.ProviderName,
"admin",
AbpRoleConsts.AdminRoleName,
permissionNames,
context?.TenantId
);

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.AdminService/appsettings.Development.json

@ -27,6 +27,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "admin",
"TableNamePrefix": "admin",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

30
aspnet-core/aspire/LINGYUN.Abp.MicroService.ApiGateway/yarp.json

@ -143,6 +143,21 @@
}
]
},
"gdpr-route": {
"ClusterId": "identity-service-cluster",
"Match": {
"Path": "/api/gdpr/{**everything}"
},
"Transforms": [
{
"HeaderPrefix": "X-Forwarded-",
"X-Forwarded": "Append"
},
{
"ResponseHeadersAllowed": "_AbpWrapResult;_AbpDontWrapResult;_AbpErrorFormat"
}
]
},
"identity-server-route": {
"ClusterId": "identity-service-cluster",
"Match": {
@ -293,6 +308,21 @@
}
]
},
"setting-management-v2-route": {
"ClusterId": "admin-service-cluster",
"Match": {
"Path": "/api/v2/setting-management/{**everything}"
},
"Transforms": [
{
"HeaderPrefix": "X-Forwarded-",
"X-Forwarded": "Append"
},
{
"ResponseHeadersAllowed": "_AbpWrapResult;_AbpDontWrapResult;_AbpErrorFormat"
}
]
},
"localization-management-route": {
"ClusterId": "localization-service-cluster",
"Match": {

19
aspnet-core/aspire/LINGYUN.Abp.MicroService.AppHost/AppHost.cs

@ -5,7 +5,8 @@ var builder = DistributedApplication.CreateBuilder(args);
// Redis
var redis = builder.AddRedis("redis",
password: builder.AddParameter("redis-password", "123456", secret: true))
.WithContainerName("redis")
.WithContainerName("redis-aspire")
.WithImageTag("8.0.2")
.WithDataVolume("redis-dev");
if (builder.Environment.IsDevelopment())
@ -16,8 +17,9 @@ if (builder.Environment.IsDevelopment())
}
// Elasticsearch
var elasticsearch = builder.AddElasticsearch("elasticsearch")
.WithContainerName("elasticsearch")
var elasticsearch = builder.AddElasticsearch("elasticsearch",
password: builder.AddParameter("elasticsearch-password", "123456", secret: true))
.WithContainerName("elasticsearch-aspire")
.WithImageTag("8.17.3")
.WithDataVolume("elasticsearch-dev")
.WithEnvironment("ES_JAVA_OPTS", "-Xms2g -Xmx2g")
@ -26,15 +28,17 @@ var elasticsearch = builder.AddElasticsearch("elasticsearch")
// Kibana
builder.AddContainer("kibana", "kibana", "8.17.3")
.WithContainerName("kibana-aspire")
.WithReference(elasticsearch)
.WithEndpoint(5601, 5601)
.WaitFor(elasticsearch);
// Postgres
var postgres = builder.AddPostgres("postgres")
.WithPassword(builder.AddParameter("postgres-pwd", "123456", secret: true))
var postgres = builder.AddPostgres("postgres",
userName: builder.AddParameter("postgres-username", "postgres", secret: true),
password: builder.AddParameter("postgres-pwd", "123456", secret: true))
.WithImage("postgres", "17-alpine")
.WithContainerName("postgres")
.WithContainerName("postgres-aspire")
.WithDataVolume("postgres-dev");
var abpDb = postgres.AddDatabase("abp");
@ -43,7 +47,8 @@ var abpDb = postgres.AddDatabase("abp");
var rabbitmq = builder.AddRabbitMQ("rabbitmq",
userName: builder.AddParameter("rabbitmq-username", "admin", secret: true),
password: builder.AddParameter("rabbitmq-password", "123456", secret: true))
.WithContainerName("rabbitmq")
.WithContainerName("rabbitmq-aspire")
.WithImageTag("3.13.1")
.WithDataVolume("rabbitmq-dev")
.WithManagementPlugin();

8
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs

@ -478,7 +478,9 @@ public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransien
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Implicit,
OpenIddictConstants.GrantTypes.Password,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,
@ -540,7 +542,9 @@ public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransien
"Abp OAuth Client",
null,
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/appsettings.Development.json

@ -58,6 +58,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "auth",
"TableNamePrefix": "auth",
"ConnectionString": "Host=localhost;Database=abp;Username=postgres;Password=123456"
},

8
aspnet-core/aspire/LINGYUN.Abp.MicroService.AuthServer/package.json

@ -1,9 +1,9 @@
{
"version": "10.2.0",
"name": "my-app-authserver",
"version": "10.4.0",
"name": "aspire-authserver",
"private": true,
"dependencies": {
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "5.2.0",
"@abp/qrcode": "10.2.0"
"@abp/aspnetcore.mvc.ui.theme.leptonxlite": "5.4.0",
"@abp/qrcode": "10.4.0"
}
}

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.IdentityService/appsettings.Development.json

@ -47,6 +47,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "ida",
"TableNamePrefix": "ida",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

8
aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/LocalizationServiceModule.Configure.cs

@ -250,6 +250,14 @@ public partial class LocalizationServiceModule
});
}
private void PreConfigureLocalization()
{
Configure<AbpLocalizationManagementOptions>(options =>
{
options.IsDynamicLocalizationInitializerHost = true;
});
}
private void ConfigureLocalization()
{
// 默认支持的本地化语言类型

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/LocalizationServiceModule.cs

@ -70,6 +70,7 @@ public partial class LocalizationServiceModule : AbpModule
PreConfigureWrapper();
PreConfigureFeature();
PreForwardedHeaders();
PreConfigureLocalization();
PreConfigureApp(configuration);
PreConfigureCAP(configuration);
}

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.LocalizationService/appsettings.Development.json

@ -27,6 +27,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "lta",
"TableNamePrefix": "lta",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

120
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/DataSeeds/NotificationDataSeeder.cs

@ -0,0 +1,120 @@
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Users;
namespace LINGYUN.Abp.MicroService.MessageService.DataSeeds;
public class NotificationDataSeeder : ITransientDependency
{
public ILogger<NotificationDataSeeder> Logger { protected get; set; }
protected INotificationSender NotificationSender { get; }
protected INotificationSubscriptionManager NotificationSubscriptionManager { get; }
public NotificationDataSeeder(
INotificationSender notificationSender,
INotificationSubscriptionManager notificationSubscriptionManager)
{
NotificationSender = notificationSender;
NotificationSubscriptionManager = notificationSubscriptionManager;
Logger = NullLogger<NotificationDataSeeder>.Instance;
}
public virtual async Task SeedAsync(DataSeedContext context)
{
await SubscribeDefaultNotifierAsync(context);
await SeedWelcomeNotifierAsync(context);
}
public async virtual Task SubscribeDefaultNotifierAsync(DataSeedContext context)
{
if (!context.Properties.TryGetValue(MessageServiceDataSeedConsts.AdminUserIdPropertyName, out var userIdString) ||
!Guid.TryParse(userIdString?.ToString(), out var adminUserId))
{
return;
}
var adminUserName = context.Properties.GetOrDefault(MessageServiceDataSeedConsts.AdminUserNamePropertyName)?.ToString()
?? MessageServiceDataSeedConsts.AdminUserNameDefaultValue;
var userIdentifer = new UserIdentifier(adminUserId, adminUserName);
// 订阅内置通知
await NotificationSubscriptionManager
.SubscribeAsync(
context.TenantId,
userIdentifer,
DefaultNotifications.SystemNotice);
await NotificationSubscriptionManager
.SubscribeAsync(
context.TenantId,
userIdentifer,
DefaultNotifications.OnsideNotice);
await NotificationSubscriptionManager
.SubscribeAsync(
context.TenantId,
userIdentifer,
DefaultNotifications.ActivityNotice);
// 订阅用户欢迎消息
await NotificationSubscriptionManager
.SubscribeAsync(
context.TenantId,
userIdentifer,
UserNotificationNames.WelcomeToApplication);
}
public async virtual Task SeedWelcomeNotifierAsync(DataSeedContext context)
{
try
{
if (!context.TenantId.HasValue)
{
return;
}
if (!context.Properties.TryGetValue(MessageServiceDataSeedConsts.AdminUserIdPropertyName, out var userIdString) ||
!Guid.TryParse(userIdString?.ToString(), out var adminUserId))
{
return;
}
var adminEmailAddress = context.Properties.GetOrDefault(MessageServiceDataSeedConsts.AdminEmailPropertyName)?.ToString()
?? MessageServiceDataSeedConsts.AdminEmailDefaultValue;
var adminUserName = context.Properties.GetOrDefault(MessageServiceDataSeedConsts.AdminUserNamePropertyName)?.ToString()
?? MessageServiceDataSeedConsts.AdminUserNameDefaultValue;
var tenantAdminUserIdentifier = new UserIdentifier(adminUserId, adminEmailAddress);
// 租户管理员订阅事件
await NotificationSubscriptionManager
.SubscribeAsync(
context.TenantId,
tenantAdminUserIdentifier,
TenantNotificationNames.NewTenantRegistered);
Logger.LogInformation("publish new tenant notification..");
await NotificationSender.SendNofiterAsync(
TenantNotificationNames.NewTenantRegistered,
new NotificationTemplate(
TenantNotificationNames.NewTenantRegistered,
formUser: adminEmailAddress,
data: new Dictionary<string, object>
{
{ "name", adminUserName },
{ "email", adminEmailAddress },
{ "id", context.TenantId },
}),
tenantAdminUserIdentifier,
context.TenantId,
NotificationSeverity.Success);
Logger.LogInformation("tenant administrator subscribes to new tenant events..");
}
catch (Exception ex)
{
Logger.LogWarning(ex, "Failed to send the tenant initialization notification.");
}
}
}

10
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDataSeedConsts.cs

@ -0,0 +1,10 @@
namespace LINGYUN.Abp.MicroService.MessageService;
public static class MessageServiceDataSeedConsts
{
public const string AdminUserIdPropertyName = "AdminUserId";
public const string AdminEmailPropertyName = "AdminEmail";
public const string AdminEmailDefaultValue = "admin@abp.io";
public const string AdminUserNamePropertyName = "AdminUserName";
public const string AdminUserNameDefaultValue = "admin";
}

33
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDataSeeder.cs

@ -0,0 +1,33 @@
using LINGYUN.Abp.MicroService.MessageService.DataSeeds;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace LINGYUN.Abp.MicroService.MessageService;
public class MessageServiceDataSeeder : ITransientDependency
{
protected NotificationDataSeeder NotificationDataSeeder { get; }
protected ICurrentTenant CurrentTenant { get; }
public MessageServiceDataSeeder(
ICurrentTenant currentTenant,
NotificationDataSeeder notificationDataSeeder)
{
CurrentTenant = currentTenant;
NotificationDataSeeder = notificationDataSeeder;
}
public async virtual Task SeedAsync(DataSeedContext context)
{
using (CurrentTenant.Change(context.TenantId))
{
await SeedNotificationAsync(context);
}
}
private async Task SeedNotificationAsync(DataSeedContext context)
{
await NotificationDataSeeder.SeedAsync(context);
}
}

64
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDbMigrationEventHandler.cs

@ -1,7 +1,4 @@
using LINGYUN.Abp.Notifications;
using Microsoft.Extensions.Logging;
using System;
using System.Collections.Generic;
using Microsoft.Extensions.Logging;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DistributedLocking;
@ -13,8 +10,7 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.MicroService.MessageService;
public class MessageServiceDbMigrationEventHandler : EfCoreDatabaseMigrationEventHandlerBase<MessageServiceMigrationsDbContext>
{
protected INotificationSender NotificationSender { get; }
protected INotificationSubscriptionManager NotificationSubscriptionManager { get; }
protected MessageServiceDataSeeder MessageServiceDataSeeder { get; }
public MessageServiceDbMigrationEventHandler(
ICurrentTenant currentTenant,
@ -23,65 +19,27 @@ public class MessageServiceDbMigrationEventHandler : EfCoreDatabaseMigrationEven
IAbpDistributedLock abpDistributedLock,
IDistributedEventBus distributedEventBus,
ILoggerFactory loggerFactory,
INotificationSender notificationSender,
INotificationSubscriptionManager notificationSubscriptionManager)
MessageServiceDataSeeder messageServiceDataSeeder)
: base(
ConnectionStringNameAttribute.GetConnStringName<MessageServiceMigrationsDbContext>(),
currentTenant, unitOfWorkManager, tenantStore, abpDistributedLock, distributedEventBus, loggerFactory)
{
NotificationSender = notificationSender;
NotificationSubscriptionManager = notificationSubscriptionManager;
MessageServiceDataSeeder = messageServiceDataSeeder;
}
protected async override Task AfterTenantCreated(TenantCreatedEto eventData, bool schemaMigrated)
{
using (CurrentTenant.Change(eventData.Id))
{
await SendNotificationAsync(eventData);
}
}
protected async virtual Task SendNotificationAsync(TenantCreatedEto eventData)
{
try
{
if (!eventData.Properties.TryGetValue("AdminUserId", out var userIdString) ||
!Guid.TryParse(userIdString, out var adminUserId))
var context = new DataSeedContext(eventData.Id);
if (eventData.Properties != null)
{
return;
foreach (var prop in eventData.Properties)
{
context.WithProperty(prop.Key, prop.Value);
}
}
var adminEmailAddress = eventData.Properties.GetOrDefault("AdminEmail") ?? "admin@abp.io";
var tenantAdminUserIdentifier = new UserIdentifier(adminUserId, adminEmailAddress);
// 租户管理员订阅事件
await NotificationSubscriptionManager
.SubscribeAsync(
eventData.Id,
tenantAdminUserIdentifier,
TenantNotificationNames.NewTenantRegistered);
Logger.LogInformation("publish new tenant notification..");
await NotificationSender.SendNofiterAsync(
TenantNotificationNames.NewTenantRegistered,
new NotificationTemplate(
TenantNotificationNames.NewTenantRegistered,
formUser: adminEmailAddress,
data: new Dictionary<string, object>
{
{ "name", eventData.Name },
{ "email", adminEmailAddress },
{ "id", eventData.Id },
}),
tenantAdminUserIdentifier,
eventData.Id,
NotificationSeverity.Success);
Logger.LogInformation("tenant administrator subscribes to new tenant events..");
}
catch (Exception ex)
{
Logger.LogWarning(ex, "Failed to send the tenant initialization notification.");
await MessageServiceDataSeeder.SeedAsync(context);
}
}
}

10
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService.EntityFrameworkCore/MessageServiceDbMigrationService.cs

@ -1,6 +1,7 @@
using LINGYUN.Abp.Data.DbMigrator;
using Microsoft.Extensions.Logging;
using System;
using System.Threading.Tasks;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DistributedLocking;
@ -11,7 +12,9 @@ using Volo.Abp.Uow;
namespace LINGYUN.Abp.MicroService.MessageService;
public class MessageServiceDbMigrationService : EfCoreRuntimeDbMigratorBase<MessageServiceMigrationsDbContext>, ITransientDependency
{
protected MessageServiceDataSeeder DataSeeder { get; }
public MessageServiceDbMigrationService(
MessageServiceDataSeeder dataSeeder,
ICurrentTenant currentTenant,
IUnitOfWorkManager unitOfWorkManager,
IServiceProvider serviceProvider,
@ -22,5 +25,12 @@ public class MessageServiceDbMigrationService : EfCoreRuntimeDbMigratorBase<Mess
ConnectionStringNameAttribute.GetConnStringName<MessageServiceMigrationsDbContext>(),
unitOfWorkManager, serviceProvider, currentTenant, abpDistributedLock, distributedEventBus, loggerFactory)
{
DataSeeder = dataSeeder;
}
protected async override Task SeedAsync()
{
// DbMigrator迁移数据种子
await DataSeeder.SeedAsync(new DataSeedContext());
}
}

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.MessageService/appsettings.Development.json

@ -93,6 +93,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "msg",
"TableNamePrefix": "msg",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/LINGYUN.Abp.MicroService.PlatformService.csproj

@ -56,6 +56,7 @@
<ProjectReference Include="..\..\framework\logging\LINGYUN.Abp.Serilog.Enrichers.UniqueId\LINGYUN.Abp.Serilog.Enrichers.UniqueId.csproj" />
<ProjectReference Include="..\..\framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Wrapper.csproj" />
<ProjectReference Include="..\..\framework\security\LINGYUN.Abp.Claims.Mapping\LINGYUN.Abp.Claims.Mapping.csproj" />
<ProjectReference Include="..\..\modules\blob-management\LINGYUN.Abp.BlobManagement.MimeCheck\LINGYUN.Abp.BlobManagement.MimeCheck.csproj" />
</ItemGroup>
<ItemGroup>

2
aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/PlatformServiceModule.cs

@ -6,6 +6,7 @@ using LINGYUN.Abp.Authorization.OrganizationUnits;
using LINGYUN.Abp.BlobManagement;
using LINGYUN.Abp.BlobManagement.Aliyun;
using LINGYUN.Abp.BlobManagement.FileSystem;
using LINGYUN.Abp.BlobManagement.MimeCheck;
using LINGYUN.Abp.BlobManagement.Minio;
using LINGYUN.Abp.BlobManagement.Tencent;
using LINGYUN.Abp.BlobStoring.BlobManagement;
@ -62,6 +63,7 @@ namespace LINGYUN.Abp.MicroService.PlatformService;
typeof(AbpBlobManagementMinioModule),
typeof(AbpBlobManagementTencentModule),
typeof(AbpBlobManagementHttpApiModule),
typeof(AbpBlobManagementMimeCheckModule),
typeof(AbpBlobStoringBlobManagementModule),
typeof(AbpImagingImageSharpModule),

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.PlatformService/appsettings.Development.json

@ -58,6 +58,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "plt",
"TableNamePrefix": "plt",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.TaskService/appsettings.Development.json

@ -24,6 +24,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "tsk",
"TableNamePrefix": "tsk",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

4
aspnet-core/aspire/LINGYUN.Abp.MicroService.WeChatService/WeChatServiceModule.Configure.cs

@ -280,6 +280,7 @@ public partial class WeChatServiceModule
Configure<FeatureManagementOptions>(options =>
{
options.IsDynamicFeatureStoreEnabled = true;
options.SaveStaticFeaturesToDatabase = true;
});
}
@ -288,7 +289,7 @@ public partial class WeChatServiceModule
Configure<PermissionManagementOptions>(options =>
{
options.IsDynamicPermissionStoreEnabled = true;
options.SaveStaticPermissionsToDatabase = false;
options.SaveStaticPermissionsToDatabase = true;
});
}
@ -297,6 +298,7 @@ public partial class WeChatServiceModule
Configure<SettingManagementOptions>(options =>
{
options.IsDynamicSettingStoreEnabled = true;
options.SaveStaticSettingsToDatabase = true;
});
}

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.WeChatService/appsettings.Development.json

@ -50,6 +50,7 @@
"FailedRetryCount": 10
},
"MySql": {
"Schema": "wechat",
"TableNamePrefix": "wechat",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.WebhookService/appsettings.Development.json

@ -55,6 +55,7 @@
"FailedRetryCount": 10
},
"PostgreSql": {
"Schema": "wkm",
"TableNamePrefix": "wkm",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

1
aspnet-core/aspire/LINGYUN.Abp.MicroService.WorkflowService/appsettings.Development.json

@ -136,6 +136,7 @@
"CollectorCleaningInterval": 3600000
},
"PostgreSql": {
"Schema": "wf",
"TableNamePrefix": "wf",
"ConnectionString": "Host=127.0.0.1;Database=abp;Username=postgres;Password=123456"
},

121
aspnet-core/framework/common/LINGYUN.Abp.EventBus.CAP/LINGYUN/Abp/EventBus/CAP/CAPDistributedEventBus.cs

@ -44,6 +44,10 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
/// </summary>
protected ConcurrentDictionary<Type, List<IEventHandlerFactory>> HandlerFactories { get; }
/// <summary>
/// 本地动态事件处理器工厂对象集合
/// </summary>
protected ConcurrentDictionary<string, List<IEventHandlerFactory>> DynamicHandlerFactories { get; }
/// <summary>
/// 本地事件集合
/// </summary>
protected ConcurrentDictionary<string, Type> EventTypes { get; }
@ -113,6 +117,7 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
JsonSerializer = jsonSerializer;
CancellationTokenProvider = cancellationTokenProvider;
CustomDistributedEventSubscriber = customDistributedEventSubscriber;
DynamicHandlerFactories = new ConcurrentDictionary<string, List<IEventHandlerFactory>>();
HandlerFactories = new ConcurrentDictionary<Type, List<IEventHandlerFactory>>();
EventTypes = new ConcurrentDictionary<string, Type>();
}
@ -165,9 +170,7 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
/// <returns></returns>
protected override async Task PublishToEventBusAsync(Type eventType, object eventData)
{
var eventName = EventNameAttribute.GetNameOrDefault(eventType);
await PublishToCapAsync(eventName, eventData, messageId: null, correlationId: CorrelationIdProvider.Get());
await PublishToCapAsync(eventType, eventData, messageId: null, correlationId: CorrelationIdProvider.Get());
}
/// <summary>
@ -178,31 +181,24 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
protected override IEnumerable<EventTypeWithEventHandlerFactories> GetHandlerFactories(Type eventType)
{
var handlerFactoryList = new List<EventTypeWithEventHandlerFactories>();
var eventNames = EventTypes.Where(x => ShouldTriggerEventForHandler(eventType, x.Value)).Select(x => x.Key).ToList();
foreach (var handlerFactory in HandlerFactories.Where(hf => ShouldTriggerEventForHandler(eventType, hf.Key)))
{
handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(handlerFactory.Key, handlerFactory.Value));
}
return handlerFactoryList.ToArray();
}
private static bool ShouldTriggerEventForHandler(Type targetEventType, Type handlerEventType)
{
//Should trigger same type
if (handlerEventType == targetEventType)
foreach (var handlerFactory in DynamicHandlerFactories.Where(aehf => eventNames.Contains(aehf.Key)))
{
return true;
handlerFactoryList.Add(new EventTypeWithEventHandlerFactories(typeof(DynamicEventData), handlerFactory.Value));
}
//TODO: Support inheritance? But it does not support on subscription to RabbitMq!
//Should trigger for inherited types
if (handlerEventType.IsAssignableFrom(targetEventType))
{
return true;
}
return handlerFactoryList.ToArray();
}
return false;
protected override Type GetEventTypeByEventName(string eventName)
{
return EventTypes.GetOrDefault(eventName);
}
protected override byte[] Serialize(object eventData)
@ -242,20 +238,27 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
public override async Task ProcessFromInboxAsync(IncomingEventInfo incomingEvent, InboxConfig inboxConfig)
{
var eventJson = Encoding.UTF8.GetString(incomingEvent.EventData);
var eventType = EventTypes.GetOrDefault(incomingEvent.EventName);
if (eventType == null)
object eventData;
if (eventType != null)
{
eventData = JsonSerializer.Deserialize(eventType, eventJson);
}
else if (DynamicHandlerFactories.ContainsKey(incomingEvent.EventName))
{
eventData = new DynamicEventData(incomingEvent.EventName, JsonSerializer.Deserialize<object>(eventJson));
eventType = typeof(DynamicEventData);
}
else
{
return;
}
var eventJson = Encoding.UTF8.GetString(incomingEvent.EventData);
var eventData = JsonSerializer.Deserialize(eventType, eventJson);
var exceptions = new List<Exception>();
using (CorrelationIdProvider.Change(incomingEvent.GetCorrelationId()))
{
await TriggerHandlersFromInboxAsync(eventType, eventData, exceptions, inboxConfig);
}
if (exceptions.Any())
{
ThrowOriginalExceptions(eventType, exceptions);
@ -264,7 +267,8 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
protected virtual async Task PublishToCapAsync(Type eventType, object eventData, Guid? messageId, string correlationId = null)
{
await PublishToCapAsync(EventNameAttribute.GetNameOrDefault(eventType), eventData, null, correlationId);
var (eventName, resolvedData) = ResolveEventForPublishing(eventType, eventData);
await PublishToCapAsync(eventName, resolvedData, null, correlationId);
}
protected virtual async Task PublishToCapAsync(string eventName, object eventData, Guid? messageId, string correlationId = null)
@ -293,4 +297,73 @@ public class CAPDistributedEventBus : DistributedEventBusBase, IDistributedEvent
await CapPublisher.PublishAsync(eventName, eventData, headers, CancellationTokenProvider.FallbackToProvider());
}
public override IDisposable Subscribe(string eventName, IEventHandlerFactory handler)
{
return NullDisposable.Instance;
}
public override void Unsubscribe(string eventName, IEventHandlerFactory factory)
{
}
public override void Unsubscribe(string eventName, IEventHandler handler)
{
}
public override void UnsubscribeAll(string eventName)
{
}
public override Task PublishAsync(string eventName, object eventData, bool onUnitOfWorkComplete = true)
{
var eventType = EventTypes.GetOrDefault(eventName);
var dynamicEventData = eventData as DynamicEventData ?? new DynamicEventData(eventName, eventData);
if (eventType != null)
{
return PublishAsync(eventType, ConvertDynamicEventData(dynamicEventData.Data, eventType), onUnitOfWorkComplete);
}
return PublishAsync(typeof(DynamicEventData), dynamicEventData, onUnitOfWorkComplete);
}
protected override IEnumerable<EventTypeWithEventHandlerFactories> GetDynamicHandlerFactories(string eventName)
{
var result = new List<EventTypeWithEventHandlerFactories>();
var eventType = GetEventTypeByEventName(eventName);
if (eventType != null)
{
return GetHandlerFactories(eventType);
}
foreach (var handlerFactory in DynamicHandlerFactories.Where(hf => hf.Key == eventName))
{
result.Add(new EventTypeWithEventHandlerFactories(typeof(DynamicEventData), handlerFactory.Value));
}
return result;
}
private static bool ShouldTriggerEventForHandler(Type targetEventType, Type handlerEventType)
{
//Should trigger same type
if (handlerEventType == targetEventType)
{
return true;
}
//TODO: Support inheritance? But it does not support on subscription to RabbitMq!
//Should trigger for inherited types
if (handlerEventType.IsAssignableFrom(targetEventType))
{
return true;
}
return false;
}
}

20
aspnet-core/framework/telemetry/LINGYUN.Abp.Telemetry.OpenTelemetry/LINGYUN/Abp/Telemetry/OpenTelemetry/AbpTelemetryOpenTelemetryModule.cs

@ -129,16 +129,16 @@ public class AbpTelemetryOpenTelemetryModule : AbpModule
});
}
if (configuration.GetValue("OpenTelemetry:ZipKin:IsEnabled", false))
{
tracing.AddZipkinExporter(zipKinOptions =>
{
var zipkinEndPoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
Check.NotNullOrWhiteSpace(zipkinEndPoint, nameof(zipkinEndPoint));
zipKinOptions.Endpoint = new Uri(zipkinEndPoint);
});
}
//if (configuration.GetValue("OpenTelemetry:ZipKin:IsEnabled", false))
//{
// tracing.AddZipkinExporter(zipKinOptions =>
// {
// var zipkinEndPoint = configuration["OpenTelemetry:ZipKin:Endpoint"];
// Check.NotNullOrWhiteSpace(zipkinEndPoint, nameof(zipkinEndPoint));
// zipKinOptions.Endpoint = new Uri(zipkinEndPoint);
// });
//}
}
private static void ConfigureMetrics(MeterProviderBuilder metrics, IConfiguration configuration)

12
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/Cryptography.cs

@ -97,7 +97,11 @@ public class Cryptography
private static string AES_encrypt(string Input, byte[] Iv, byte[] Key)
{
#if NET462
var aes = new RijndaelManaged();
#else
var aes = Aes.Create();
#endif
//秘钥的大小,以位为单位
aes.KeySize = 256;
//支持的块大小
@ -125,7 +129,11 @@ public class Cryptography
private static string AES_encrypt(byte[] Input, byte[] Iv, byte[] Key)
{
#if NET462
var aes = new RijndaelManaged();
#else
var aes = Aes.Create();
#endif
//秘钥的大小,以位为单位
aes.KeySize = 256;
//支持的块大小
@ -196,7 +204,11 @@ public class Cryptography
}
private static byte[] AES_decrypt(string Input, byte[] Iv, byte[] Key)
{
#if NET462
var aes = new RijndaelManaged();
#else
var aes = Aes.Create();
#endif
aes.KeySize = 256;
aes.BlockSize = 128;
aes.Mode = CipherMode.CBC;

8
aspnet-core/framework/wechat/LINGYUN.Abp.WeChat.Common/LINGYUN/Abp/WeChat/Common/Utils/WXBizMsgCrypt.cs

@ -241,10 +241,14 @@ public class WXBizMsgCrypt
var hash = "";
try
{
#if NET462
sha = new SHA1CryptoServiceProvider();
#else
sha = SHA1.Create();
#endif
enc = new ASCIIEncoding();
var dataToHash = enc.GetBytes(raw);
var dataHashed = sha.ComputeHash(dataToHash);
byte[] dataToHash = enc.GetBytes(raw);
byte[] dataHashed = sha.ComputeHash(dataToHash);
hash = BitConverter.ToString(dataHashed).Replace("-", "");
hash = hash.ToLower();
}

3
aspnet-core/migrate-database.bat

@ -1,9 +1,8 @@
@echo off
cls
call .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run
call .\migrate-db-cmd.bat LY.MicroService.AuthServer.DbMigrator auth-server --run
call .\migrate-db-cmd.bat LY.MicroService.IdentityServer.DbMigrator identityserver4-admin --run
call .\migrate-db-cmd.bat LY.MicroService.Platform.DbMigrator platform --run
call .\migrate-db-cmd.bat LY.MicroService.LocalizationManagement.DbMigrator localization --run
call .\migrate-db-cmd.bat LY.MicroService.RealtimeMessage.DbMigrator messages --run
call .\migrate-db-cmd.bat LY.MicroService.TaskManagement.DbMigrator task-management --run

8
aspnet-core/migrations/LY.MicroService.Applications.Single.EntityFrameworkCore/DataSeeder/OpenIddictDataSeederContributor.cs

@ -236,7 +236,9 @@ public class OpenIddictDataSeederContributor : OpenIddictDataSeedContributorBase
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Implicit,
OpenIddictConstants.GrantTypes.Password,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,
@ -298,7 +300,9 @@ public class OpenIddictDataSeederContributor : OpenIddictDataSeedContributorBase
"Abp OAuth Client",
null,
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,

8
aspnet-core/migrations/LY.MicroService.AuthServer.EntityFrameworkCore/DataSeeds/OpenIddictDataSeeder.cs

@ -479,7 +479,9 @@ public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransien
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.Implicit,
OpenIddictConstants.GrantTypes.Password,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,
@ -541,7 +543,9 @@ public class OpenIddictDataSeeder : OpenIddictDataSeedContributorBase, ITransien
"Abp OAuth Client",
null,
[OpenIddictConstants.GrantTypes.AuthorizationCode,
OpenIddictConstants.GrantTypes.RefreshToken],
OpenIddictConstants.GrantTypes.RefreshToken,
// TODO: 引用项目?
"link_user"],
[OpenIddictConstants.Scopes.OpenId,
OpenIddictConstants.Scopes.Email,
OpenIddictConstants.Scopes.Roles,

18
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionUserInactiveSynchronizer.cs

@ -1,5 +1,6 @@
using System.Threading.Tasks;
using Volo.Abp.DependencyInjection;
using Volo.Abp.DistributedLocking;
using Volo.Abp.Domain.Entities.Events.Distributed;
using Volo.Abp.EventBus.Distributed;
using Volo.Abp.Uow;
@ -10,20 +11,29 @@ public class IdentitySessionUserInactiveSynchronizer :
IDistributedEventHandler<EntityCreatedEto<IdentitySessionEto>>,
ITransientDependency
{
private readonly IAbpDistributedLock _distributedLock;
private readonly IIdentityUserInactiveRepository _identityUserInactiveRepository;
public IdentitySessionUserInactiveSynchronizer(IIdentityUserInactiveRepository identityUserInactiveRepository)
public IdentitySessionUserInactiveSynchronizer(
IAbpDistributedLock distributedLock,
IIdentityUserInactiveRepository identityUserInactiveRepository)
{
_distributedLock = distributedLock;
_identityUserInactiveRepository = identityUserInactiveRepository;
}
[UnitOfWork]
public async virtual Task HandleEventAsync(EntityCreatedEto<IdentitySessionEto> eventData)
{
var userInactive = await _identityUserInactiveRepository.FindByUserIdAsync(eventData.Entity.UserId);
if (userInactive == null)
await using var lockHandle = await _distributedLock.TryAcquireAsync(
$"{nameof(IdentitySessionUserInactiveSynchronizer)}_{nameof(IdentitySessionEto)}");
if (lockHandle != null)
{
await _identityUserInactiveRepository.DeleteAsync(userInactive);
var userInactive = await _identityUserInactiveRepository.FindByUserIdAsync(eventData.Entity.UserId);
if (userInactive != null)
{
await _identityUserInactiveRepository.DeleteAsync(userInactive);
}
}
}
}

2
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserDeactivationNotifier.tpl

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{L "InactiveUserDeactivationNotifier"}}</title>

2
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserDeletionNotifier.tpl

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{L "InactiveUserDeletionNotifier"}}</title>

2
aspnet-core/modules/identity/LINGYUN.Abp.Identity.Notifications/LINGYUN/Abp/Identity/Notifications/Templates/InactiveUserReminderNotifier.tpl

@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="zh-CN">
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{L "InactiveUserReminderNotifier"}}</title>

24
aspnet-core/modules/platform/LINGYUN.Abp.UI.Navigation.VueVbenAdmin5/LINGYUN/Abp/UI/Navigation/VueVbenAdmin5/AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider.cs

@ -17,6 +17,7 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
context.Add(GetTaskManagement());
context.Add(GetWebhooksManagement());
context.Add(GetTextTemplating());
context.Add(GetWeChatManagement());
context.Add(GetVbenDemos());
}
@ -811,4 +812,27 @@ public class AbpUINavigationVueVbenAdmin5NavigationDefinitionProvider : Navigati
return new NavigationDefinition(textTemplating);
}
private static NavigationDefinition GetWeChatManagement()
{
var wechat = new ApplicationMenu(
name: "Vben5Wechat",
displayName: "微信集成",
url: "/wechat",
component: "",
description: "微信集成",
icon: "ant-design:wechat-outlined")
.SetProperty("title", "abp.wechat.title");
wechat.AddItem(
new ApplicationMenu(
name: "Vben5WechatSettings",
displayName: "微信设置",
url: "/wechat/settings",
component: "/wechat/settings/index",
icon: "ant-design:setting-outlined",
description: "微信设置")
.SetProperty("title", "abp.wechat.settings"));
return new NavigationDefinition(wechat);
}
}

4
aspnet-core/modules/task-management/LINGYUN.Abp.TaskManagement.Application.Contracts/LINGYUN/Abp/TaskManagement/BackgroundJobInfoDto.cs

@ -105,4 +105,8 @@ public class BackgroundJobInfoDto : ExtensibleAuditedEntityDto<string>, IHasConc
/// 0或更小不生效
/// </summary>
public int LockTimeOut { get; set; }
/// <summary>
/// 指定作业运行节点
/// </summary>
public string NodeName { get; set; }
}

1
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs

@ -788,6 +788,7 @@ public partial class MicroServiceApplicationsSingleModule
Configure<AbpLocalizationManagementOptions>(options =>
{
options.SaveStaticLocalizationsToDatabase = true;
options.IsDynamicLocalizationInitializerHost = true;
});
}

2
aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs

@ -121,6 +121,8 @@ namespace LY.MicroService.Applications.Single;
typeof(AbpOpenIddictWeChatModule),
// OpenIddict扩展模块 企业微信认证
typeof(AbpOpenIddictWeChatWorkModule),
// OpenIddict扩展模块 关联账户
typeof(AbpOpenIddictLinkUserModule),
// OpenIddict扩展模块 扫码登录
typeof(AbpOpenIddictQrCodeModule),

253
aspnet-core/services/LY.MicroService.Applications.Single/Settings/SystemGroupSettingDefinitionProvider.cs

@ -0,0 +1,253 @@
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using Volo.Abp.Emailing;
using Volo.Abp.Settings;
using Volo.Abp.Timing;
using ValueType = Volo.Abp.Settings.ValueType;
namespace LY.MicroService.Applications.Single.Settings;
public class SystemGroupSettingDefinitionProvider : SettingDefinitionProvider
{
private const string GroupName = "System";
protected ITimezoneProvider TimezoneProvider { get; }
protected AbpLocalizationOptions LocalizationOptions { get; }
protected IStringLocalizerFactory StringLocalizerFactory { get; }
public SystemGroupSettingDefinitionProvider(
ITimezoneProvider timezoneProvider,
IStringLocalizerFactory stringLocalizerFactory,
IOptions<AbpLocalizationOptions> localizationOptions)
{
TimezoneProvider = timezoneProvider;
StringLocalizerFactory = stringLocalizerFactory;
LocalizationOptions = localizationOptions.Value;
}
public override void Define(ISettingDefinitionContext context)
{
SetSystemSettingGroup(context);
SetEmailSettingGroup(context);
}
private void SetSystemSettingGroup(ISettingDefinitionContext context)
{
context.GetOrNull(LocalizationSettingNames.DefaultLanguage)
?.WithGroup(GroupName, L("Settings:System"), order: 0)
?.WithParent("Language", L("Settings:System.Language"), order: 0)
?.WithOrder(0)
?.WithOptions(LocalizationOptions.Languages.Select(l => new NameValue<string>(l.DisplayName, l.CultureName)))
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
var timezoneSetting = context.GetOrNull(TimingSettingNames.TimeZone);
if (timezoneSetting != null)
{
var stringLocalizer = StringLocalizerFactory.Create<AbpSettingManagementResource>();
var timezones = TimeZoneHelper.GetTimezones(TimezoneProvider.GetIanaTimezones());
timezones.Insert(0, new NameValue
{
Name = stringLocalizer["DefaultTimeZone"],
Value = "Unspecified"
});
timezoneSetting
.WithGroup(
GroupName,
L("Settings:System"),
order: 0,
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.TimeZone])
.WithParent("Timing", L("Settings:System.Timing"), order: 0)
.WithOrder(1)
.WithOptions(timezones)
.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
}
}
private static void SetEmailSettingGroup(ISettingDefinitionContext context)
{
context.GetOrNull(EmailSettingNames.DefaultFromAddress)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Default",
L("Settings:Emailing.Default"),
order: 0)
?.WithOrder(0)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.DefaultFromDisplayName)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Default",
L("Settings:Emailing.Default"),
order: 0)
?.WithOrder(1)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Domain)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(0)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Host)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(1)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Port)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(2)
?.WithValueType(ValueType.Number)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.UserName)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(3)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Password)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(4)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.EnableSsl)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(5)
?.WithValueType(ValueType.Boolean)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.UseDefaultCredentials)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(6)
?.WithValueType(ValueType.Boolean)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
}
public static LocalizableString L(string name)
{
return LocalizableString.Create<AbpSettingManagementResource>(name);
}
}

34
aspnet-core/services/LY.MicroService.Applications.Single/appsettings.Development.json

@ -27,7 +27,6 @@
"Auditing": {
"AllEntitiesSelector": true
},
"CAP": {
"IsEnabled": false,
"EventBus": {
@ -49,6 +48,25 @@
"Configuration": "localhost"
}
},
"Calendar": {
"DefaultWorkdays": [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday"
],
"DefaultWorkTimes": [
{
"StartTime": "08:00:00",
"EndTime": "12:00:00"
},
{
"StartTime": "14:00:00",
"EndTime": "18:00:00"
}
]
},
"DistributedCache": {
"HideErrors": true,
"KeyPrefix": "LINGYUN.Abp.Application",
@ -147,7 +165,7 @@
},
"Lifetime": {
"AuthorizationCode": "00:05:00",
"AccessToken": "00:05:00",
"AccessToken": "02:00:00",
"DeviceCode": "00:10:00",
"IdentityToken": "00:20:00",
"RefreshToken": "06:00:00",
@ -181,6 +199,9 @@
"RequireConfirmedPhoneNumber": false
}
},
"AIManagement": {
"IsDynamicStoreEnabled": true
},
"FeatureManagement": {
"IsDynamicStoreEnabled": true
},
@ -220,14 +241,6 @@
"Elasticsearch": {
"NodeUris": "http://localhost:9200"
},
"Minio": {
"WithSSL": false,
"BucketName": "blobs",
"EndPoint": "localhost:19000",
"AccessKey": "ZD43kNpimiJf9mCuomTP",
"SecretKey": "w8IqMgi4Tnz0DGzN8jZ7IJWq7OEdbUnAU0jlZxQK",
"CreateBucketIfNotExists": false
},
"Serilog": {
"MinimumLevel": {
"Default": "Information",
@ -235,6 +248,7 @@
"System": "Warning",
"Microsoft": "Warning",
"Microsoft.EntityFrameworkCore": "Warning",
"LINGYUN.Abp.BlobManagement": "Debug",
"DotNetCore": "Warning"
}
},

260
aspnet-core/services/LY.MicroService.BackendAdmin.HttpApi.Host/Settings/SystemGroupSettingDefinitionProvider.cs

@ -0,0 +1,260 @@
using LINGYUN.Abp.SettingManagement;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Options;
using System.Linq;
using Volo.Abp;
using Volo.Abp.Emailing;
using Volo.Abp.Localization;
using Volo.Abp.SettingManagement;
using Volo.Abp.SettingManagement.Localization;
using Volo.Abp.Settings;
using Volo.Abp.Timing;
using ValueType = Volo.Abp.Settings.ValueType;
namespace LY.MicroService.BackendAdmin.Settings;
public class SystemGroupSettingDefinitionProvider : SettingDefinitionProvider
{
private const string GroupName = "System";
protected ITimezoneProvider TimezoneProvider { get; }
protected AbpLocalizationOptions LocalizationOptions { get; }
protected IStringLocalizerFactory StringLocalizerFactory { get; }
public SystemGroupSettingDefinitionProvider(
ITimezoneProvider timezoneProvider,
IStringLocalizerFactory stringLocalizerFactory,
IOptions<AbpLocalizationOptions> localizationOptions)
{
TimezoneProvider = timezoneProvider;
StringLocalizerFactory = stringLocalizerFactory;
LocalizationOptions = localizationOptions.Value;
}
public override void Define(ISettingDefinitionContext context)
{
SetSystemSettingGroup(context);
SetEmailSettingGroup(context);
}
private void SetSystemSettingGroup(ISettingDefinitionContext context)
{
context.GetOrNull(LocalizationSettingNames.DefaultLanguage)
?.WithGroup(GroupName, L("Settings:System"), order: 0)
?.WithParent("Language", L("Settings:System.Language"), order: 0)
?.WithOrder(0)
?.WithOptions(LocalizationOptions.Languages.Select(l => new NameValue<string>(l.DisplayName, l.CultureName)))
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
var timezoneSetting = context.GetOrNull(TimingSettingNames.TimeZone);
if (timezoneSetting != null)
{
var stringLocalizer = StringLocalizerFactory.Create<AbpSettingManagementResource>();
var timezones = TimeZoneHelper.GetTimezones(TimezoneProvider.GetIanaTimezones());
timezones.Insert(0, new NameValue
{
Name = stringLocalizer["DefaultTimeZone"],
Value = "Unspecified"
});
timezoneSetting
.WithGroup(
GroupName,
L("Settings:System"),
order: 0,
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.TimeZone])
.WithParent("Timing", L("Settings:System.Timing"), order: 0)
.WithOrder(1)
.WithOptions(timezones)
.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
}
}
private static void SetEmailSettingGroup(ISettingDefinitionContext context)
{
context.GetOrNull(EmailSettingNames.DefaultFromAddress)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Default",
L("Settings:Emailing.Default"),
order: 0)
?.WithOrder(0)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.DefaultFromDisplayName)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Default",
L("Settings:Emailing.Default"),
order: 0)
?.WithOrder(1)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Domain)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(0)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Host)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(1)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Port)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(2)
?.WithValueType(ValueType.Number)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.UserName)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(3)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.Password)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(4)
?.WithValueType(ValueType.String)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.EnableSsl)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(5)
?.WithValueType(ValueType.Boolean)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
context.GetOrNull(EmailSettingNames.Smtp.UseDefaultCredentials)
?.WithGroup(
"Emailing",
L("Settings:Emailing"),
order: 1,
requiredFeatures: [SettingManagementFeatures.Enable, SettingManagementFeatures.AllowChangingEmailSettings],
requiredPermissions: [Volo.Abp.SettingManagement.SettingManagementPermissions.Emailing])
?.WithParent(
"Smtp",
L("Settings:Emailing.Smtp"),
order: 1,
requiredPermissions: [AbpSettingManagementPermissions.Settings.Manager])
?.WithOrder(6)
?.WithValueType(ValueType.Boolean)
?.ReplaceProviders(
DefaultValueSettingValueProvider.ProviderName,
ConfigurationSettingValueProvider.ProviderName,
GlobalSettingValueProvider.ProviderName,
TenantSettingValueProvider.ProviderName);
}
public static LocalizableString L(string name)
{
return LocalizableString.Create<AbpSettingManagementResource>(name);
}
}

2
aspnet-core/tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests/LINGYUN.Abp.BlobStoring.Aliyun.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.BlobStoring.Nexus.Tests/LINGYUN.Abp.BlobStoring.Nexus.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.DataProtection.Tests/LINGYUN.Abp.DataProtection.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.EntityFrameworkCore.Tests/LINGYUN.Abp.EntityFrameworkCore.Tests.csproj

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests/LINGYUN.Abp.ExceptionHandling.Emailing.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests/LINGYUN.Abp.Features.LimitValidation.Redis.Tests.csproj

@ -6,7 +6,7 @@
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Features.LimitValidation.Tests/LINGYUN.Abp.Features.LimitValidation.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.IdGenerator.Tests/LINGYUN.Abp.IdGenerator.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Localization.Xml.Tests/LINGYUN.Abp.Localization.Xml.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Location.Baidu.Tests/LINGYUN.Abp.Location.Baidu.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Location.Tencent.Tests/LINGYUN.Abp.Location.Tencent.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.Rules.RulesEngine.Tests/LINGYUN.Abp.Rules.RulesEngine.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

2
aspnet-core/tests/LINGYUN.Abp.WeChat.Work.Tests/LINGYUN.Abp.WeChat.Work.Tests.csproj

@ -4,7 +4,7 @@
<TargetFramework>net10.0</TargetFramework>
<RootNamespace />
<IsPackable>false</IsPackable>
<Configurations>Debug;Release;PostgreSQL</Configurations>
<Configurations>Debug;Release</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

Loading…
Cancel
Save