diff --git a/apps/vue/src/store/modules/user.ts b/apps/vue/src/store/modules/user.ts index 8b2949d5f..1afe0a4d7 100644 --- a/apps/vue/src/store/modules/user.ts +++ b/apps/vue/src/store/modules/user.ts @@ -201,6 +201,9 @@ export const useUserStore = defineStore({ if (userInfo?.avatarUrl) { outgoingUserInfo.avatar = formatUrl(userInfo.avatarUrl); } + if (userInfo?.picture) { + outgoingUserInfo.avatar = formatUrl(userInfo.picture); + } this.setUserInfo(outgoingUserInfo); return outgoingUserInfo; diff --git a/aspnet-core/LINGYUN.MicroService.SingleProject.sln b/aspnet-core/LINGYUN.MicroService.SingleProject.sln index 6eb708628..34467c4f9 100644 --- a/aspnet-core/LINGYUN.MicroService.SingleProject.sln +++ b/aspnet-core/LINGYUN.MicroService.SingleProject.sln @@ -492,7 +492,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Mvc. EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper", "framework\mvc\LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper\LINGYUN.Abp.AspNetCore.Mvc.Idempotent.Wrapper.csproj", "{0D34162C-0CE3-4D7B-B19A-4786C616D0B3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.AspNetCore.Wrapper", "framework\common\LINGYUN.Abp.AspNetCore.Wrapper\LINGYUN.Abp.AspNetCore.Wrapper.csproj", "{FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LINGYUN.Abp.AspNetCore.Wrapper", "framework\common\LINGYUN.Abp.AspNetCore.Wrapper\LINGYUN.Abp.AspNetCore.Wrapper.csproj", "{FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LINGYUN.Abp.OpenIddict.AspNetCore", "modules\openIddict\LINGYUN.Abp.OpenIddict.AspNetCore\LINGYUN.Abp.OpenIddict.AspNetCore.csproj", "{6026DAE3-F2AD-4F6B-99EF-EEAAA5873861}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1292,6 +1294,10 @@ Global {FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE}.Debug|Any CPU.Build.0 = Debug|Any CPU {FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE}.Release|Any CPU.ActiveCfg = Release|Any CPU {FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE}.Release|Any CPU.Build.0 = Release|Any CPU + {6026DAE3-F2AD-4F6B-99EF-EEAAA5873861}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6026DAE3-F2AD-4F6B-99EF-EEAAA5873861}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6026DAE3-F2AD-4F6B-99EF-EEAAA5873861}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6026DAE3-F2AD-4F6B-99EF-EEAAA5873861}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1534,6 +1540,7 @@ Global {3690518A-D6C3-42CC-AEC2-6D48C6987F68} = {5531E2F2-2FC2-45A0-93C7-7FC6F6A4F0AD} {0D34162C-0CE3-4D7B-B19A-4786C616D0B3} = {5531E2F2-2FC2-45A0-93C7-7FC6F6A4F0AD} {FDBA1B4A-CC5D-4710-AB8C-FA5A91B91BDE} = {40A9F0DB-66AA-42A8-8670-9DD6DA992103} + {6026DAE3-F2AD-4F6B-99EF-EEAAA5873861} = {7C714185-D3D9-4D94-B5CB-D857A0091F04} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {711A43C0-A2F8-4E5C-9B9F-F2551E4B3FF1} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs index fd973cd91..70013ffe1 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.OrganizaztionUnits/LINGYUN/Abp/Identity/OrganizaztionUnits/OrganizationUnitClaimsPrincipalContributor.cs @@ -11,7 +11,7 @@ namespace LINGYUN.Abp.Identity.OrganizationUnits; public class OrganizationUnitClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency { // https://github.com/dotnet/aspnetcore/blob/main/src/Identity/Extensions.Core/src/UserClaimsPrincipalFactory.cs#L74 - private static string IdentityAuthenticationType => "Identity.Application"; + // private static string IdentityAuthenticationType => "Identity.Application"; private readonly IIdentityUserRepository _identityUserRepository; private readonly IIdentityRoleRepository _identityRoleRepository; @@ -26,8 +26,15 @@ public class OrganizationUnitClaimsPrincipalContributor : IAbpClaimsPrincipalCon public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) { - var claimsIdentity = context.ClaimsPrincipal.Identities.First(x => x.AuthenticationType == IdentityAuthenticationType); - + var claimsIdentity = context.ClaimsPrincipal.Identities.FirstOrDefault(); + if (claimsIdentity == null) + { + return; + } + if (claimsIdentity.FindAll(x => x.Type == AbpOrganizationUnitClaimTypes.OrganizationUnit).Any()) + { + return; + } var userId = claimsIdentity.FindUserId(); if (!userId.HasValue) { @@ -38,7 +45,11 @@ public class OrganizationUnitClaimsPrincipalContributor : IAbpClaimsPrincipalCon foreach (var userOu in userOus) { - claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOu.Id.ToString())); + var userOuId = userOu.Id.ToString(); + if (!claimsIdentity.HasClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOuId)) + { + claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, userOuId)); + } } var userRoles = claimsIdentity @@ -49,7 +60,11 @@ public class OrganizationUnitClaimsPrincipalContributor : IAbpClaimsPrincipalCon var roleOus = await _identityRoleRepository.GetOrganizationUnitsAsync(userRoles); foreach (var roleOu in roleOus) { - claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOu.Id.ToString())); + var roleOuId = roleOu.Id.ToString(); + if (!claimsIdentity.HasClaim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOuId)) + { + claimsIdentity.AddClaim(new Claim(AbpOrganizationUnitClaimTypes.OrganizationUnit, roleOuId)); + } } context.ClaimsPrincipal.AddIdentityIfNotContains(claimsIdentity); diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xml b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xml new file mode 100644 index 000000000..1715698cc --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xsd b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xsd new file mode 100644 index 000000000..3f3946e28 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/FodyWeavers.xsd @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + 'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed. + + + + + A comma-separated list of error codes that can be safely ignored in assembly verification. + + + + + 'false' to turn off automatic generation of the XML Schema file. + + + + + \ No newline at end of file diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj new file mode 100644 index 000000000..2cc018d80 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN.Abp.OpenIddict.AspNetCore.csproj @@ -0,0 +1,19 @@ + + + + + + + net7.0 + + + + + + + + + + + + diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs new file mode 100644 index 000000000..4ecb11e58 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AbpOpenIddictAspNetCoreModule.cs @@ -0,0 +1,20 @@ +using LINGYUN.Abp.Identity; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Modularity; +using VoloAbpOpenIddictAspNetCoreModule = Volo.Abp.OpenIddict.AbpOpenIddictAspNetCoreModule; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore; + +[DependsOn( + typeof(AbpIdentityDomainSharedModule), + typeof(VoloAbpOpenIddictAspNetCoreModule))] +public class AbpOpenIddictAspNetCoreModule : AbpModule +{ + public override void PreConfigureServices(ServiceConfigurationContext context) + { + PreConfigure(builder => + { + builder.RegisterClaims(new[] { IdentityConsts.ClaimType.Avatar.Name } ); + }); + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs new file mode 100644 index 000000000..2177f8717 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/AvatarUrlClaimsPrincipalContributor.cs @@ -0,0 +1,33 @@ +using LINGYUN.Abp.Identity; +using Microsoft.Extensions.DependencyInjection; +using System.Linq; +using System.Security.Claims; +using System.Security.Principal; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Identity; +using Volo.Abp.Security.Claims; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore; +public class AvatarUrlClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency +{ + public async virtual Task ContributeAsync(AbpClaimsPrincipalContributorContext context) + { + var identity = context.ClaimsPrincipal.Identities.FirstOrDefault(); + if (identity != null) + { + if (identity.HasClaim(x => x.Type == IdentityConsts.ClaimType.Avatar.Name)) + { + return; + } + var userManager = context.ServiceProvider.GetRequiredService(); + var user = await userManager.GetUserAsync(context.ClaimsPrincipal); + var userClaims = await userManager.GetClaimsAsync(user); + var userAvatarUrl = userClaims.FirstOrDefault(x => x.Type == IdentityConsts.ClaimType.Avatar.Name); + if (userAvatarUrl != null) + { + identity.AddIfNotContains(new Claim(IdentityConsts.ClaimType.Avatar.Name, userAvatarUrl.Value)); + } + } + } +} diff --git a/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs new file mode 100644 index 000000000..6c9d232b5 --- /dev/null +++ b/aspnet-core/modules/openIddict/LINGYUN.Abp.OpenIddict.AspNetCore/LINGYUN/Abp/OpenIddict/AspNetCore/Controllers/UserInfoController.cs @@ -0,0 +1,68 @@ +using LINGYUN.Abp.Identity; +using OpenIddict.Abstractions; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Security.Claims; +using VoloUserInfoController = Volo.Abp.OpenIddict.Controllers.UserInfoController; + +namespace LINGYUN.Abp.OpenIddict.AspNetCore.Controllers; + +[ExposeServices( + typeof(VoloUserInfoController), + typeof(UserInfoController))] +public class UserInfoController : VoloUserInfoController +{ + protected async override Task> GetUserInfoClaims() + { + var user = await UserManager.GetUserAsync(User); + if (user == null) + { + return null; + } + + var claims = new Dictionary(StringComparer.Ordinal) + { + // Note: the "sub" claim is a mandatory claim and must be included in the JSON response. + [OpenIddictConstants.Claims.Subject] = await UserManager.GetUserIdAsync(user) + }; + + if (User.HasScope(OpenIddictConstants.Scopes.Profile)) + { + claims[AbpClaimTypes.TenantId] = user.TenantId; + claims[OpenIddictConstants.Claims.PreferredUsername] = user.UserName; + claims[OpenIddictConstants.Claims.FamilyName] = user.Surname; + claims[OpenIddictConstants.Claims.GivenName] = user.Name; + // 重写添加用户头像 + var picture = user.Claims.FirstOrDefault(x => x.ClaimType == IdentityConsts.ClaimType.Avatar.Name); + if (picture != null) + { + claims[OpenIddictConstants.Claims.Picture] = picture.ClaimValue; + } + } + + if (User.HasScope(OpenIddictConstants.Scopes.Email)) + { + claims[OpenIddictConstants.Claims.Email] = await UserManager.GetEmailAsync(user); + claims[OpenIddictConstants.Claims.EmailVerified] = await UserManager.IsEmailConfirmedAsync(user); + } + + if (User.HasScope(OpenIddictConstants.Scopes.Phone)) + { + claims[OpenIddictConstants.Claims.PhoneNumber] = await UserManager.GetPhoneNumberAsync(user); + claims[OpenIddictConstants.Claims.PhoneNumberVerified] = await UserManager.IsPhoneNumberConfirmedAsync(user); + } + + if (User.HasScope(OpenIddictConstants.Scopes.Roles)) + { + claims[OpenIddictConstants.Claims.Role] = await UserManager.GetRolesAsync(user); + } + + // Note: the complete list of standard claims supported by the OpenID Connect specification + // can be found here: http://openid.net/specs/openid-connect-core-1_0.html#StandardClaims + + return claims; + } +} diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs index fbc6d56d9..f9e1786df 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Application/LINGYUN/Abp/WebhooksManagement/WebhookSubscriptionAppService.cs @@ -35,7 +35,7 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I var subscription = new WebhookSubscription( GuidGenerator.Create(), input.WebhookUri, - input.ToWebhookHeadersString(), + input.ToSubscribedWebhooksString(), input.ToWebhookHeadersString(), input.Secret, input.TenantId ?? CurrentTenant.Id) @@ -100,7 +100,7 @@ public class WebhookSubscriptionAppService : WebhooksManagementAppServiceBase, I var inputHeaders = input.ToWebhookHeadersString(); if (!string.Equals(subscription.Headers, inputHeaders, StringComparison.InvariantCultureIgnoreCase)) { - subscription.SetHeaders(input.ToWebhookHeadersString()); + subscription.SetHeaders(inputHeaders); } subscription.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs index e254d86c6..809d64c3f 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStore.cs @@ -127,7 +127,7 @@ public class DynamicWebhookDefinitionStore : IDynamicWebhookDefinitionStore, ITr protected async virtual Task UpdateInMemoryStoreCache() { var webhookGroupRecords = await WebhookGroupRepository.GetListAsync(); - var webhookRecords = await WebhookRepository.GetListAsync(); + var webhookRecords = await WebhookRepository.GetAvailableListAsync(); await StoreCache.FillAsync(webhookGroupRecords, webhookRecords); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs index 9f0a40c6a..7d4a5a71b 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/DynamicWebhookDefinitionStoreInMemoryCache.cs @@ -98,10 +98,15 @@ public class DynamicWebhookDefinitionStoreInMemoryCache : WebhookGroupDefinition webhookGroup, WebhookDefinitionRecord webhookRecord) { + ILocalizableString description = null; + if (!webhookRecord.Description.IsNullOrWhiteSpace()) + { + description = LocalizableStringSerializer.Deserialize(webhookRecord.Description); + } var webhook = webhookGroup.AddWebhook( webhookRecord.Name, LocalizableStringSerializer.Deserialize(webhookRecord.DisplayName), - LocalizableStringSerializer.Deserialize(webhookRecord.Description) + description ); WebhookDefinitions[webhook.Name] = webhook; diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs index 2c2e90353..c85916b0d 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.Domain/LINGYUN/Abp/WebhooksManagement/IWebhookDefinitionRecordRepository.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Volo.Abp.Domain.Repositories; @@ -10,4 +11,6 @@ public interface IWebhookDefinitionRecordRepository : IBasicRepository FindByNameAsync( string name, CancellationToken cancellationToken = default); + + Task> GetAvailableListAsync(CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs index fe2db854d..098bf72ac 100644 --- a/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs +++ b/aspnet-core/modules/webhooks/LINGYUN.Abp.WebhooksManagement.EntityFrameworkCore/LINGYUN/Abp/WebhooksManagement/EntityFrameworkCore/EfCoreWebhookDefinitionRecordRepository.cs @@ -1,5 +1,6 @@ using Microsoft.EntityFrameworkCore; using System; +using System.Collections.Generic; using System.Linq; using System.Threading; using System.Threading.Tasks; @@ -18,12 +19,19 @@ public class EfCoreWebhookDefinitionRecordRepository : { } - public async Task FindByNameAsync( + public async virtual Task FindByNameAsync( string name, CancellationToken cancellationToken = default) { return await (await GetDbSetAsync()) .OrderBy(x => x.Id) - .FirstOrDefaultAsync(r => r.Name == name, cancellationToken); + .FirstOrDefaultAsync(r => r.Name == name, GetCancellationToken(cancellationToken)); + } + + public async virtual Task> GetAvailableListAsync(CancellationToken cancellationToken = default) + { + return await (await GetDbSetAsync()) + .Where(x => x.IsEnabled == true) + .ToListAsync(GetCancellationToken(cancellationToken)); } } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj index f66160f26..baceecefa 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj +++ b/aspnet-core/services/LY.MicroService.Applications.Single/LY.MicroService.Applications.Single.csproj @@ -145,6 +145,7 @@ + diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs index b02de38da..289713f67 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.Configure.cs @@ -670,6 +670,7 @@ public partial class MicroServiceApplicationsSingleModule { options.IsEnabled = true; options.IgnoreNamespaces.Add("Elsa"); + options.IgnoreNamespaces.Add("LINGYUN.Abp.OssManagement"); }); } diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs index 192d2f5b2..3dc099a12 100644 --- a/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs +++ b/aspnet-core/services/LY.MicroService.Applications.Single/MicroServiceApplicationsSingleModule.cs @@ -54,6 +54,7 @@ using LINGYUN.Abp.Notifications.SignalR; using LINGYUN.Abp.Notifications.WeChat.MiniProgram; using LINGYUN.Abp.OpenApi.Authorization; using LINGYUN.Abp.OpenIddict; +using LINGYUN.Abp.OpenIddict.AspNetCore; using LINGYUN.Abp.OpenIddict.Portal; using LINGYUN.Abp.OpenIddict.Sms; using LINGYUN.Abp.OpenIddict.WeChat; @@ -107,7 +108,6 @@ using Volo.Abp.EventBus; using Volo.Abp.FeatureManagement.EntityFrameworkCore; using Volo.Abp.Identity.AspNetCore; using Volo.Abp.Modularity; -using Volo.Abp.OpenIddict; using Volo.Abp.OpenIddict.EntityFrameworkCore; using Volo.Abp.PermissionManagement.EntityFrameworkCore; using Volo.Abp.PermissionManagement.Identity; @@ -151,7 +151,6 @@ namespace LY.MicroService.Applications.Single; typeof(AbpNotificationsHttpApiModule), typeof(AbpNotificationsEntityFrameworkCoreModule), typeof(AbpOpenIddictAspNetCoreModule), - typeof(AbpOpenIddictDomainModule), typeof(AbpOpenIddictApplicationModule), typeof(AbpOpenIddictHttpApiModule), typeof(AbpOpenIddictEntityFrameworkCoreModule), diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml new file mode 100644 index 000000000..67d69aa2a --- /dev/null +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml @@ -0,0 +1,21 @@ + + + + + true + false + true + Release + Any CPU + FileSystem + bin\Release\net7.0\publish\ + FileSystem + <_TargetId>Folder + + net7.0 + 83d2f8f2-82c7-4919-9b65-d0fbf0b5324c + false + + \ No newline at end of file diff --git a/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml.user b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml.user new file mode 100644 index 000000000..58d4ce414 --- /dev/null +++ b/aspnet-core/services/LY.MicroService.Applications.Single/Properties/PublishProfiles/FolderProfile.pubxml.user @@ -0,0 +1,11 @@ + + + + + <_PublishTargetUrl>D:\C Sharp\Open-Sources\abp-next-admin\aspnet-core\services\LY.MicroService.Applications.Single\bin\Release\net7.0\publish\ + True|2023-10-28T08:18:57.7769358Z;True|2023-10-28T14:39:34.8714667+08:00; + + + \ No newline at end of file