diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json index 3fac4ec96..43a9ef871 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/en.json @@ -49,6 +49,7 @@ "ProfileTab:Session": "Sessions", "ProfileTab:TwoFactor": "TwoFactor", "ProfileTab:Authenticator": "Authenticator", - "ProfileTab:SecurityLog": "Security Log" + "ProfileTab:SecurityLog": "Security Log", + "PhoneNumberChangedMessage": "Your mobile number has been successfully changed." } } \ No newline at end of file diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json index a550172c7..7800b78e6 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application.Contracts/LINGYUN/Abp/Account/Localization/Resources/zh-Hans.json @@ -49,6 +49,7 @@ "ProfileTab:Session": "会话管理", "ProfileTab:TwoFactor": "双因素身份验证", "ProfileTab:Authenticator": "身份验证程序", - "ProfileTab:SecurityLog": "安全日志" + "ProfileTab:SecurityLog": "安全日志", + "PhoneNumberChangedMessage": "您的手机号码已成功更改." } } \ No newline at end of file diff --git a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs index 8758fa718..20bd32dc9 100644 --- a/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs +++ b/aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/UserProfilePictureProvider.cs @@ -68,7 +68,7 @@ public class UserProfileUserPictureProvider : IUserPictureProvider (await UserManager.UpdateAsync(user)).CheckErrors(); - var pictureName = $"users/{userId}/avatar/{pictureBlobId}"; + var pictureName = $"{userId}/avatar/{pictureBlobId}"; await AccountBlobContainer.SaveAsync(pictureName, stream, true); } @@ -90,7 +90,7 @@ public class UserProfileUserPictureProvider : IUserPictureProvider return Stream.Null; } - var pictureName = $"users/{user.Id:N}/avatar/{picture}"; + var pictureName = $"{user.Id:N}/avatar/{picture}"; return await AccountBlobContainer.ExistsAsync(pictureName) ? await AccountBlobContainer.GetAsync(pictureName) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs index 77bc7cd75..e8a413ffe 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/IIdentitySessionRepository.cs @@ -21,5 +21,5 @@ public interface IIdentitySessionRepository : Volo.Abp.Identity.IIdentitySession Task> GetListAsync(Guid userId, CancellationToken cancellationToken = default); - Task DeleteAllAsync(string sessionId, Guid? exceptSessionId = null, CancellationToken cancellationToken = default); + Task DeleteAllSessionAsync(string sessionId, Guid? exceptSessionId = null, CancellationToken cancellationToken = default); } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs index bff98e2c2..9ad838cea 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionCacheItemSynchronizer.cs @@ -1,4 +1,7 @@ -using System; +using LINGYUN.Abp.Identity.Settings; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging.Abstractions; +using System; using System.Threading.Tasks; using Volo.Abp.DependencyInjection; using Volo.Abp.Domain.Entities.Events; @@ -6,6 +9,8 @@ using Volo.Abp.Domain.Entities.Events.Distributed; using Volo.Abp.EventBus; using Volo.Abp.EventBus.Distributed; using Volo.Abp.Identity; +using Volo.Abp.Settings; +using Volo.Abp.Uow; namespace LINGYUN.Abp.Identity.Session; public class IdentitySessionCacheItemSynchronizer : @@ -15,15 +20,21 @@ public class IdentitySessionCacheItemSynchronizer : ILocalEventHandler>, ITransientDependency { + public ILogger Logger { protected get; set; } + protected ISettingProvider SettingProvider { get; } protected IIdentitySessionCache IdentitySessionCache { get; } protected IIdentitySessionStore IdentitySessionStore { get; } public IdentitySessionCacheItemSynchronizer( + ISettingProvider settingProvider, IIdentitySessionCache identitySessionCache, IIdentitySessionStore identitySessionStore) { + SettingProvider = settingProvider; IdentitySessionCache = identitySessionCache; IdentitySessionStore = identitySessionStore; + + Logger = NullLogger.Instance; } public async virtual Task HandleEventAsync(EntityDeletedEto eventData) @@ -31,21 +42,11 @@ public class IdentitySessionCacheItemSynchronizer : await IdentitySessionCache.RemoveAsync(eventData.Entity.SessionId); } + [UnitOfWork] public async virtual Task HandleEventAsync(EntityCreatedEto eventData) { - var identitySessionCacheItem = new IdentitySessionCacheItem( - eventData.Entity.Device, - eventData.Entity.DeviceInfo, - eventData.Entity.UserId, - eventData.Entity.SessionId, - eventData.Entity.ClientId, - eventData.Entity.IpAddresses, - eventData.Entity.SignedIn, - eventData.Entity.LastAccessed); - - await IdentitySessionCache.RefreshAsync( - eventData.Entity.SessionId, - identitySessionCacheItem); + await RefreshSessionCache(eventData.Entity); + await CheckConcurrentLoginStrategy(eventData.Entity); } public async virtual Task HandleEventAsync(IdentitySessionChangeAccessedEvent eventData) @@ -73,4 +74,68 @@ public class IdentitySessionCacheItemSynchronizer : // 用户被删除, 移除所有会话 await IdentitySessionStore.RevokeAllAsync(eventData.Entity.Id); } + + protected async virtual Task RefreshSessionCache(IdentitySessionEto session) + { + var identitySessionCacheItem = new IdentitySessionCacheItem( + session.Device, + session.DeviceInfo, + session.UserId, + session.SessionId, + session.ClientId, + session.IpAddresses, + session.SignedIn, + session.LastAccessed); + + await IdentitySessionCache.RefreshAsync( + session.SessionId, + identitySessionCacheItem); + } + + protected async virtual Task CheckConcurrentLoginStrategy(IdentitySessionEto session) + { + // 创建一个会话后根据策略使其他会话失效 + var strategySet = await SettingProvider.GetOrNullAsync(IdentitySettingNames.Session.ConcurrentLoginStrategy); + + Logger.LogDebug($"The concurrent login strategy is: {strategySet}"); + + if (!strategySet.IsNullOrWhiteSpace() && Enum.TryParse(strategySet, true, out var strategy)) + { + switch (strategy) + { + // 限制用户相同设备 + case ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit: + + var sameTypeDevicesCountSet = await SettingProvider.GetAsync(IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit, 1); + + Logger.LogDebug($"Clear other sessions on the device {session.Device} and save only {sameTypeDevicesCountSet} sessions."); + + await IdentitySessionStore.RevokeWithAsync( + session.UserId, + session.Device, + session.Id, + sameTypeDevicesCountSet); + break; + // 限制登录设备 + case ConcurrentLoginStrategy.LogoutFromSameTypeDevices: + + Logger.LogDebug($"Clear all other sessions on the device {session.Device}."); + + await IdentitySessionStore.RevokeAllAsync( + session.UserId, + session.Device, + session.Id); + break; + // 限制多端登录 + case ConcurrentLoginStrategy.LogoutFromAllDevices: + + Logger.LogDebug($"Clear all other user sessions."); + + await IdentitySessionStore.RevokeAllAsync( + session.UserId, + session.Id); + break; + } + } + } } diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs deleted file mode 100644 index d34cd4a39..000000000 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionEntityCreatedEventHandler.cs +++ /dev/null @@ -1,75 +0,0 @@ -using LINGYUN.Abp.Identity.Settings; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Logging.Abstractions; -using System; -using System.Threading.Tasks; -using Volo.Abp.Caching; -using Volo.Abp.DependencyInjection; -using Volo.Abp.Domain.Entities.Events; -using Volo.Abp.EventBus; -using Volo.Abp.Identity; -using Volo.Abp.Settings; - -namespace LINGYUN.Abp.Identity.Session; -public class IdentitySessionEntityCreatedEventHandler : - ILocalEventHandler>, - ITransientDependency -{ - public ILogger Logger { protected get; set; } - - private readonly ISettingProvider _settingProvider; - private readonly IIdentitySessionStore _identitySessionStore; - private readonly IDistributedCache _identitySessionCache; - - public IdentitySessionEntityCreatedEventHandler( - ISettingProvider settingProvider, - IIdentitySessionStore identitySessionStore, - IDistributedCache identitySessionCache) - { - _settingProvider = settingProvider; - _identitySessionStore = identitySessionStore; - _identitySessionCache = identitySessionCache; - - Logger = NullLogger.Instance; - } - - public async virtual Task HandleEventAsync(EntityCreatedEventData eventData) - { - // 创建一个会话后根据策略使其他会话失效 - var strategySet = await _settingProvider.GetOrNullAsync(IdentitySettingNames.Session.ConcurrentLoginStrategy); - - Logger.LogDebug($"The concurrent login strategy is: {strategySet}"); - - if (!strategySet.IsNullOrWhiteSpace() && Enum.TryParse(strategySet, true, out var strategy)) - { - switch (strategy) - { - // 限制用户相同设备 - case ConcurrentLoginStrategy.LogoutFromSameTypeDevicesLimit: - var sameTypeDevicesCountSet = await _settingProvider.GetAsync(IdentitySettingNames.Session.LogoutFromSameTypeDevicesLimit, 1); - Logger.LogDebug($"Clear other sessions on the device {eventData.Entity.Device} and save only {sameTypeDevicesCountSet} sessions."); - await _identitySessionStore.RevokeWithAsync( - eventData.Entity.UserId, - eventData.Entity.Device, - eventData.Entity.Id, - sameTypeDevicesCountSet); - break; - // 限制登录设备 - case ConcurrentLoginStrategy.LogoutFromSameTypeDevices: - Logger.LogDebug($"Clear all other sessions on the device {eventData.Entity.Device}."); - await _identitySessionStore.RevokeAllAsync( - eventData.Entity.UserId, - eventData.Entity.Device, - eventData.Entity.Id); - break; - // 限制多端登录 - case ConcurrentLoginStrategy.LogoutFromAllDevices: - Logger.LogDebug($"Clear all other user sessions."); - await _identitySessionStore.RevokeAllAsync( - eventData.Entity.UserId, - eventData.Entity.Id); - break; - } - } - } -} diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs index dcf4c5e26..ed127f7d9 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.Domain/LINGYUN/Abp/Identity/Session/IdentitySessionStore.cs @@ -126,7 +126,7 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency string sessionId, CancellationToken cancellationToken = default) { - await IdentitySessionRepository.DeleteAllAsync(sessionId, cancellationToken: cancellationToken); + await IdentitySessionRepository.DeleteAllSessionAsync(sessionId, cancellationToken: cancellationToken); } public async virtual Task RevokeAllAsync( @@ -134,7 +134,7 @@ public class IdentitySessionStore : IIdentitySessionStore, ITransientDependency Guid? exceptSessionId = null, CancellationToken cancellationToken = default) { - await IdentitySessionRepository.DeleteAllAsync(userId, exceptSessionId, cancellationToken: cancellationToken); + await IdentitySessionRepository.DeleteAllAsync(userId: userId, exceptSessionId: exceptSessionId, cancellationToken: cancellationToken); } public async virtual Task RevokeAllAsync( diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs index c94fbec3f..49e9b0b49 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.EntityFrameworkCore/LINGYUN/Abp/Identity/EntityFrameworkCore/EfCoreIdentitySessionRepository.cs @@ -52,7 +52,7 @@ public class EfCoreIdentitySessionRepository : Volo.Abp.Identity.EntityFramework .ToListAsync(GetCancellationToken(cancellationToken)); } - public async virtual Task DeleteAllAsync( + public async virtual Task DeleteAllSessionAsync( string sessionId, Guid? exceptSessionId = null, CancellationToken cancellationToken = default) diff --git a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs index f88d2d86c..d8e54c287 100644 --- a/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs +++ b/aspnet-core/modules/identity/LINGYUN.Abp.Identity.QrCode/LINGYUN/Abp/Identity/QrCode/QrCodeLoginProvider.cs @@ -153,4 +153,5 @@ public class QrCodeLoginProvider : IQrCodeLoginProvider, ITransientDependency return await UserManager.GenerateUserTokenAsync(user, QrCodeLoginProviderConsts.Name, QrCodeLoginProviderConsts.Purpose); - }} + } +} diff --git a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementOptions.cs b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementOptions.cs index e2b7988b7..c9fe5f701 100644 --- a/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementOptions.cs +++ b/aspnet-core/modules/localization-management/LINGYUN.Abp.LocalizationManagement.Domain/LINGYUN/Abp/LocalizationManagement/AbpLocalizationManagementOptions.cs @@ -5,7 +5,7 @@ public class AbpLocalizationManagementOptions /// /// 保存本地化文本到数据库 /// - public bool SaveStaticLocalizationsToDatabase { get; set; } + public bool SaveStaticLocalizationsToDatabase { get; set; } = true; public AbpLocalizationManagementOptions() { diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.md b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.md index 64d9a87fa..79c3c65e5 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.md +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.BlobStoring.OssManagement/README.md @@ -1,47 +1,47 @@ -# LINGYUN.Abp.BlobStoring.OssManagement - -abp框架对象存储提供者**IBlobProvider**的Oss管理模块实现 - -## 配置使用 - -模块按需引用, 依赖于OssManagement模块, 所以需要配置远端Oss管理模块的客户端代理 - -事先定义**appsettings.json**文件 - -```json -{ - "OssManagement": { - "Bucket": "你定义的BucketName" - }, - "RemoteServices": { - "AbpOssManagement": { - "BaseUrl": "http://127.0.0.1:30025", - "IdentityClient": "InternalServiceClient", - "UseCurrentAccessToken": false - } - }, - "IdentityClients": { - "InternalServiceClient": { - "Authority": "http://127.0.0.1:44385", - "RequireHttps": false, - "GrantType": "client_credentials", - "Scope": "lingyun-abp-application", - "ClientId": "InternalServiceClient", - "ClientSecret": "1q2w3E*" - } - } -} - -``` - -```csharp -[DependsOn(typeof(AbpBlobStoringOssManagementModule))] -public class YouProjectModule : AbpModule -{ - public override void ConfigureServices(ServiceConfigurationContext context) - { - var configuration = context.Services.GetConfiguration(); - var preActions = context.Services.GetPreConfigureActions(); +# LINGYUN.Abp.BlobStoring.OssManagement + +abp框架对象存储提供者**IBlobProvider**的Oss管理模块实现 + +## 配置使用 + +模块按需引用, 依赖于OssManagement模块, 所以需要配置远端Oss管理模块的客户端代理 + +事先定义**appsettings.json**文件 + +```json +{ + "OssManagement": { + "Bucket": "你定义的BucketName" + }, + "RemoteServices": { + "AbpOssManagement": { + "BaseUrl": "http://127.0.0.1:30025", + "IdentityClient": "InternalServiceClient", + "UseCurrentAccessToken": false + } + }, + "IdentityClients": { + "InternalServiceClient": { + "Authority": "http://127.0.0.1:44385", + "RequireHttps": false, + "GrantType": "client_credentials", + "Scope": "lingyun-abp-application", + "ClientId": "InternalServiceClient", + "ClientSecret": "1q2w3E*" + } + } +} + +``` + +```csharp +[DependsOn(typeof(AbpBlobStoringOssManagementModule))] +public class YouProjectModule : AbpModule +{ + public override void ConfigureServices(ServiceConfigurationContext context) + { + var configuration = context.Services.GetConfiguration(); + var preActions = context.Services.GetPreConfigureActions(); Configure(options => { preActions.Configure(options); @@ -64,6 +64,6 @@ public class YouProjectModule : AbpModule }); }); }); - } -} -``` + } +} +``` diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs index fb83ae959..299923cbd 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.HttpApi.Client/LINGYUN/Abp/OssManagement/AbpOssManagementHttpApiClientModule.cs @@ -1,6 +1,7 @@ using Microsoft.Extensions.DependencyInjection; using Volo.Abp.Http.Client; using Volo.Abp.Modularity; +using Volo.Abp.VirtualFileSystem; namespace LINGYUN.Abp.OssManagement; @@ -15,5 +16,10 @@ public class AbpOssManagementHttpApiClientModule : AbpModule typeof(AbpOssManagementApplicationContractsModule).Assembly, OssManagementRemoteServiceConsts.RemoteServiceName ); + + Configure(options => + { + options.FileSets.AddEmbedded(); + }); } } diff --git a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/LINGYUN/Abp/OssManagement/Minio/MinioOssContainer.cs b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/LINGYUN/Abp/OssManagement/Minio/MinioOssContainer.cs index 36abbd161..5b81355c7 100644 --- a/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/LINGYUN/Abp/OssManagement/Minio/MinioOssContainer.cs +++ b/aspnet-core/modules/oss-management/LINGYUN.Abp.OssManagement.Minio/LINGYUN/Abp/OssManagement/Minio/MinioOssContainer.cs @@ -499,10 +499,13 @@ public class MinioOssContainer : OssContainerBase, IOssObjectExpireor { var configuration = ConfigurationProvider.Get(); var minioConfiguration = configuration.GetMinioConfiguration(); - - return bucket.IsNullOrWhiteSpace() - ? BlobNormalizeNamingService.NormalizeContainerName(configuration, minioConfiguration.BucketName!) - : BlobNormalizeNamingService.NormalizeContainerName(configuration, bucket); + var blobPath = minioConfiguration.BucketName; + if (string.Equals(bucket, blobPath, StringComparison.InvariantCultureIgnoreCase)) + { + return bucket; + } + + return bucket; } protected virtual string GetPrefixPath() diff --git a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs index 9757afe4f..daa2afcb1 100644 --- a/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs +++ b/aspnet-core/modules/platform/LINGYUN.Platform.Domain/LINGYUN/Platform/Routes/Route.cs @@ -1,6 +1,8 @@ using JetBrains.Annotations; using System; +using System.Collections.Generic; using Volo.Abp; +using Volo.Abp.Data; using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.MultiTenancy; @@ -58,6 +60,32 @@ public abstract class Route : FullAuditedAggregateRoot, IMultiTenant TenantId = tenantId; } + public void WithRequiredFeatures(string[] features) + { + var requiresFeatures = features?.JoinAsString(",") ?? ""; + + this.SetProperty("RequiredFeatures", requiresFeatures); + } + + public string[] GetRequiredFeatures() + { + var requiresFeaturesObj = this.GetProperty("RequiredFeatures"); + return requiresFeaturesObj?.ToString()?.Split(",") ?? Array.Empty(); + } + + public void WithRequiredPermissions(string[] permissions) + { + var requiresPermissions = permissions?.JoinAsString(",") ?? ""; + + this.SetProperty("RequiredPermissions", requiresPermissions); + } + + public string[] GetRequiredPermissions() + { + var requiresPermissionsObj = this.GetProperty("RequiredPermissions"); + return requiresPermissionsObj?.ToString()?.Split(",") ?? Array.Empty(); + } + public override int GetHashCode() { return Name.GetHashCode(); diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/en.json b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/en.json index 6ecc5729d..1e68342c1 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/en.json +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/en.json @@ -22,6 +22,10 @@ "Description:Providers": "A list of allowed providers to get/set value of this setting, An empty list indicates that all providers are allowed.", "DisplayName:ExtraProperties": "Properties", "Description:ExtraProperties": "Can be used to get/set custom properties for this setting definition.", + "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "Is self-registration enabled", + "Description:Abp.Account.IsSelfRegistrationEnabled": "Whether a user can register the account by him or herself.", + "DisplayName:Abp.Account.EnableLocalLogin": "Authenticate with a local account", + "Description:Abp.Account.EnableLocalLogin": "Indicates if the server will allow users to authenticate with a local account.", "Definition:AddNew": "Add New", "DeleteOrRestore": "Delete/Restore", "ItemWillBeDeleteOrRestoreMessage": "If you have changed the Settings, you will revert to the default Settings. Otherwise, the custom Settings are removed.", diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/zh-Hans.json b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/zh-Hans.json index 8c94b28a8..ec57aa9ce 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/zh-Hans.json +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.Application/LINGYUN/Abp/SettingManagement/Localization/Resources/zh-Hans.json @@ -22,6 +22,10 @@ "Description:Providers": "允许提供程序获取/设置此设置的值的列表,空列表表示允许所有提供程序.", "DisplayName:ExtraProperties": "扩展属性", "Description:ExtraProperties": "可用于获取/设置此设置定义的自定义属性.", + "DisplayName:Abp.Account.IsSelfRegistrationEnabled": "是否启用了自行注册", + "Description:Abp.Account.IsSelfRegistrationEnabled": "用户是否可以自己注册账户。", + "DisplayName:Abp.Account.EnableLocalLogin": "使用本地账户进行身份验证", + "Description:Abp.Account.EnableLocalLogin": "表示服务器是否允许用户使用本地账户进行身份验证。", "Definition:AddNew": "添加新设置", "DeleteOrRestore": "删除/还原", "ItemWillBeDeleteOrRestoreMessage": "如果已改变设置, 将还原到默认设置项。否则会删除自定义设置.", diff --git a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs index b86d79496..d84a01574 100644 --- a/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs +++ b/aspnet-core/modules/settings/LINGYUN.Abp.SettingManagement.HttpApi/LINGYUN/Abp/SettingManagement/AbpSettingManagementHttpApiModule.cs @@ -1,6 +1,8 @@ using Localization.Resources.AbpUi; using Microsoft.Extensions.DependencyInjection; +using Volo.Abp.Account.Localization; using Volo.Abp.AspNetCore.Mvc; +using Volo.Abp.Identity.Localization; using Volo.Abp.Localization; using Volo.Abp.Modularity; using Volo.Abp.SettingManagement.Localization; @@ -28,7 +30,9 @@ public class AbpSettingManagementHttpApiModule : AbpModule options.Resources .Get() .AddBaseTypes( - typeof(AbpUiResource) + typeof(AbpUiResource), + typeof(IdentityResource), + typeof(AccountResource) ); }); }