66 changed files with 3468 additions and 79 deletions
File diff suppressed because one or more lines are too long
@ -0,0 +1,21 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<EmbeddedResource Include="LINGYUN\Abp\Auditing\Localization\Resources\*.json" /> |
||||
|
<Content Remove="LINGYUN\Abp\Auditing\Localization\Resources\*.json" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Volo.Abp.Features" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.Authorization" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.AuditLogging.Domain.Shared" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.Identity.Domain.Shared" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="3.1.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,36 @@ |
|||||
|
using Volo.Abp.Application; |
||||
|
using Volo.Abp.AuditLogging; |
||||
|
using Volo.Abp.AuditLogging.Localization; |
||||
|
using Volo.Abp.Authorization; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Identity; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Modularity; |
||||
|
using Volo.Abp.VirtualFileSystem; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(AbpFeaturesModule), |
||||
|
typeof(AbpAuthorizationModule), |
||||
|
typeof(AbpAuditLoggingDomainSharedModule), |
||||
|
typeof(AbpIdentityDomainSharedModule), |
||||
|
typeof(AbpDddApplicationContractsModule))] |
||||
|
public class AbpAuditingApplicationContractsModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<AbpVirtualFileSystemOptions>(options => |
||||
|
{ |
||||
|
options.FileSets.AddEmbedded<AbpAuditingApplicationContractsModule>(); |
||||
|
}); |
||||
|
|
||||
|
Configure<AbpLocalizationOptions>(options => |
||||
|
{ |
||||
|
options.Resources |
||||
|
.Get<AuditLoggingResource>() |
||||
|
.AddVirtualJson("/LINGYUN/Abp/Auditing/Localization/Resources"); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,7 @@ |
|||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
public static class AuditingRemoteServiceConsts |
||||
|
{ |
||||
|
public const string RemoteServiceName = "AbpAuditing"; |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,37 @@ |
|||||
|
using Volo.Abp.AuditLogging.Localization; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Validation.StringValues; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Features |
||||
|
{ |
||||
|
public class AuditingFeatureDefinitionProvider : FeatureDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IFeatureDefinitionContext context) |
||||
|
{ |
||||
|
var auditingGroup = context.AddGroup( |
||||
|
name: AuditingFeatureNames.GroupName, |
||||
|
displayName: L("Features:Auditing")); |
||||
|
|
||||
|
auditingGroup.AddFeature( |
||||
|
name: AuditingFeatureNames.AuditLog.Default, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:DisplayName:AuditLog"), |
||||
|
description: L("Features:Description:AuditLog"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator()) |
||||
|
); |
||||
|
auditingGroup.AddFeature( |
||||
|
name: AuditingFeatureNames.SecurityLog.Default, |
||||
|
defaultValue: true.ToString(), |
||||
|
displayName: L("Features:DisplayName:SecurityLog"), |
||||
|
description: L("Features:Description:SecurityLog"), |
||||
|
valueType: new ToggleStringValueType(new BooleanValueValidator()) |
||||
|
); |
||||
|
} |
||||
|
|
||||
|
protected LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<AuditLoggingResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
namespace LINGYUN.Abp.Auditing.Features |
||||
|
{ |
||||
|
public static class AuditingFeatureNames |
||||
|
{ |
||||
|
public const string GroupName = "AbpAuditing"; |
||||
|
public class AuditLog |
||||
|
{ |
||||
|
public const string Default = GroupName + ".AuditLog"; |
||||
|
} |
||||
|
|
||||
|
public class SecurityLog |
||||
|
{ |
||||
|
public const string Default = GroupName + ".SecurityLog"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
{ |
||||
|
"culture": "en", |
||||
|
"texts": { |
||||
|
"Permissions:Auditing": "Auditing", |
||||
|
"Permissions:AuditLog": "Audit log", |
||||
|
"Permissions:SecurityLog": "Security log", |
||||
|
"Permissions:DeleteLog": "Delete", |
||||
|
"Features:Auditing": "Auditing", |
||||
|
"Features:DisplayName:AuditLog": "Audit log", |
||||
|
"Features:Description:AuditLog": "Whether to enable audit logging", |
||||
|
"Features:DisplayName:SecurityLog": "Security log", |
||||
|
"Features:Description:SecurityLog": "Whether to enable security logging" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
{ |
||||
|
"culture": "zh-Hans", |
||||
|
"texts": { |
||||
|
"Permissions:Auditing": "内部审计", |
||||
|
"Permissions:AuditLog": "审计日志", |
||||
|
"Permissions:SecurityLog": "安全日志", |
||||
|
"Permissions:DeleteLog": "删除日志", |
||||
|
"Features:Auditing": "内部审计", |
||||
|
"Features:DisplayName:AuditLog": "审计日志", |
||||
|
"Features:Description:AuditLog": "是否启用审计日志功能", |
||||
|
"Features:DisplayName:SecurityLog": "安全日志", |
||||
|
"Features:Description:SecurityLog": "是否启用安全日志功能" |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public class AuditLogActionDto : ExtensibleEntityDto<Guid> |
||||
|
{ |
||||
|
public string ServiceName { get; set; } |
||||
|
|
||||
|
public string MethodName { get; set; } |
||||
|
|
||||
|
public string Parameters { get; set; } |
||||
|
|
||||
|
public DateTime ExecutionTime { get; set; } |
||||
|
|
||||
|
public int ExecutionDuration { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,55 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public class AuditLogDto : ExtensibleEntityDto<Guid> |
||||
|
{ |
||||
|
public string ApplicationName { get; set; } |
||||
|
|
||||
|
public Guid? UserId { get; set; } |
||||
|
|
||||
|
public string UserName { get; set; } |
||||
|
|
||||
|
public Guid? TenantId { get; set; } |
||||
|
|
||||
|
public string TenantName { get; set; } |
||||
|
|
||||
|
public Guid? ImpersonatorUserId { get; set; } |
||||
|
|
||||
|
public Guid? ImpersonatorTenantId { get; set; } |
||||
|
|
||||
|
public DateTime ExecutionTime { get; set; } |
||||
|
|
||||
|
public int ExecutionDuration { get; set; } |
||||
|
|
||||
|
public string ClientIpAddress { get; set; } |
||||
|
|
||||
|
public string ClientName { get; set; } |
||||
|
|
||||
|
public string ClientId { get; set; } |
||||
|
|
||||
|
public string CorrelationId { get; set; } |
||||
|
|
||||
|
public string BrowserInfo { get; set; } |
||||
|
|
||||
|
public string HttpMethod { get; set; } |
||||
|
|
||||
|
public string Url { get; set; } |
||||
|
|
||||
|
public string Exceptions { get; set; } |
||||
|
|
||||
|
public string Comments { get; set; } |
||||
|
|
||||
|
public int? HttpStatusCode { get; set; } |
||||
|
public List<EntityChangeDto> EntityChanges { get; set; } |
||||
|
public List<AuditLogActionDto> Actions { get; set; } |
||||
|
|
||||
|
public AuditLogDto() |
||||
|
{ |
||||
|
EntityChanges = new List<EntityChangeDto>(); |
||||
|
Actions = new List<AuditLogActionDto>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,21 @@ |
|||||
|
using System; |
||||
|
using System.Net; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public class AuditLogGetByPagedDto : PagedAndSortedResultRequestDto |
||||
|
{ |
||||
|
public DateTime? StartTime { get; set; } |
||||
|
public DateTime? EndTime { get; set; } |
||||
|
public string HttpMethod { get; set; } |
||||
|
public string Url { get; set; } |
||||
|
public string UserName { get; set; } |
||||
|
public string ApplicationName { get; set; } |
||||
|
public string CorrelationId { get; set; } |
||||
|
public int? MaxExecutionDuration { get; set; } |
||||
|
public int? MinExecutionDuration { get; set; } |
||||
|
public bool? HasException { get; set; } |
||||
|
public HttpStatusCode? HttpStatusCode { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Auditing; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public class EntityChangeDto : ExtensibleEntityDto<Guid> |
||||
|
{ |
||||
|
public DateTime ChangeTime { get; set; } |
||||
|
|
||||
|
public EntityChangeType ChangeType { get; set; } |
||||
|
|
||||
|
public Guid? EntityTenantId { get; set; } |
||||
|
|
||||
|
public string EntityId { get; set; } |
||||
|
|
||||
|
public string EntityTypeFullName { get; set; } |
||||
|
public List<EntityPropertyChangeDto> PropertyChanges { get; set; } |
||||
|
public EntityChangeDto() |
||||
|
{ |
||||
|
PropertyChanges = new List<EntityPropertyChangeDto>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public class EntityPropertyChangeDto : EntityDto<Guid> |
||||
|
{ |
||||
|
public string NewValue { get; set; } |
||||
|
|
||||
|
public string OriginalValue { get; set; } |
||||
|
|
||||
|
public string PropertyName { get; set; } |
||||
|
|
||||
|
public string PropertyTypeFullName { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
public interface IAuditLogAppService : IApplicationService |
||||
|
{ |
||||
|
Task<PagedResultDto<AuditLogDto>> GetListAsync(AuditLogGetByPagedDto input); |
||||
|
|
||||
|
Task DeleteAsync(Guid id); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,35 @@ |
|||||
|
using Volo.Abp.AuditLogging.Localization; |
||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Volo.Abp.Localization; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Permissions |
||||
|
{ |
||||
|
public class AuditingPermissionDefinitionProvider : PermissionDefinitionProvider |
||||
|
{ |
||||
|
public override void Define(IPermissionDefinitionContext context) |
||||
|
{ |
||||
|
var auditingGroup = context.AddGroup( |
||||
|
name: AuditingPermissionNames.GroupName, |
||||
|
displayName: L("Permissions:Auditing")); |
||||
|
|
||||
|
var auditLogPermission= auditingGroup.AddPermission( |
||||
|
name: AuditingPermissionNames.AuditLog.Default, |
||||
|
displayName: L("Permissions:AuditLog")); |
||||
|
auditLogPermission.AddChild( |
||||
|
name: AuditingPermissionNames.AuditLog.Delete, |
||||
|
displayName: L("Permissions:DeleteLog")); |
||||
|
|
||||
|
var securityLogPermission = auditingGroup.AddPermission( |
||||
|
name: AuditingPermissionNames.SecurityLog.Default, |
||||
|
displayName: L("Permissions:SecurityLog")); |
||||
|
securityLogPermission.AddChild( |
||||
|
name: AuditingPermissionNames.SecurityLog.Delete, |
||||
|
displayName: L("Permissions:DeleteLog")); |
||||
|
} |
||||
|
|
||||
|
protected LocalizableString L(string name) |
||||
|
{ |
||||
|
return LocalizableString.Create<AuditLoggingResource>(name); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
namespace LINGYUN.Abp.Auditing.Permissions |
||||
|
{ |
||||
|
public class AuditingPermissionNames |
||||
|
{ |
||||
|
public const string GroupName = "AbpAuditing"; |
||||
|
public class AuditLog |
||||
|
{ |
||||
|
public const string Default = GroupName + ".AuditLog"; |
||||
|
public const string Delete = Default + ".Delete"; |
||||
|
} |
||||
|
|
||||
|
public class SecurityLog |
||||
|
{ |
||||
|
public const string Default = GroupName + ".SecurityLog"; |
||||
|
public const string Delete = Default + ".Delete"; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Application.Services; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Security |
||||
|
{ |
||||
|
public interface ISecurityLogAppService : IApplicationService |
||||
|
{ |
||||
|
Task<PagedResultDto<SecurityLogDto>> GetListAsync(SecurityLogGetByPagedDto input); |
||||
|
|
||||
|
Task DeleteAsync(Guid id); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Security |
||||
|
{ |
||||
|
public class SecurityLogDto : ExtensibleEntityDto<Guid> |
||||
|
{ |
||||
|
public string ApplicationName { get; set; } |
||||
|
|
||||
|
public string Identity { get; set; } |
||||
|
|
||||
|
public string Action { get; set; } |
||||
|
|
||||
|
public Guid? UserId { get; set; } |
||||
|
|
||||
|
public string UserName { get; set; } |
||||
|
|
||||
|
public string TenantName { get; set; } |
||||
|
|
||||
|
public string ClientId { get; set; } |
||||
|
|
||||
|
public string CorrelationId { get; set; } |
||||
|
|
||||
|
public string ClientIpAddress { get; set; } |
||||
|
|
||||
|
public string BrowserInfo { get; set; } |
||||
|
|
||||
|
public DateTime CreationTime { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,18 @@ |
|||||
|
using System; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Security |
||||
|
{ |
||||
|
public class SecurityLogGetByPagedDto : PagedAndSortedResultRequestDto |
||||
|
{ |
||||
|
public DateTime? StartTime { get; set; } |
||||
|
public DateTime? EndTime { get; set; } |
||||
|
public string ApplicationName { get; set; } |
||||
|
public string Identity { get; set; } |
||||
|
public string ActionName { get; set; } |
||||
|
public Guid? UserId { get; set; } |
||||
|
public string UserName { get; set; } |
||||
|
public string ClientId { get; set; } |
||||
|
public string CorrelationId { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netstandard2.0</TargetFramework> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Volo.Abp.AutoMapper" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.AuditLogging.Domain" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.Identity.Domain" Version="3.1.0" /> |
||||
|
<PackageReference Include="Volo.Abp.Ddd.Application" Version="3.1.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\LINGYUN.Abp.Auditing.Application.Contracts\LINGYUN.Abp.Auditing.Application.Contracts.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,24 @@ |
|||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.AuditLogging; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(AbpAutoMapperModule), |
||||
|
typeof(AbpAuditLoggingDomainModule), |
||||
|
typeof(AbpAuditingApplicationContractsModule))] |
||||
|
public class AbpAuditingApplicationModule : AbpModule |
||||
|
{ |
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
context.Services.AddAutoMapperObjectMapper<AbpAuditingApplicationModule>(); |
||||
|
|
||||
|
Configure<AbpAutoMapperOptions>(options => |
||||
|
{ |
||||
|
options.AddProfile<AbpAuditingMapperProfile>(validate: true); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,25 @@ |
|||||
|
using AutoMapper; |
||||
|
using LINGYUN.Abp.Auditing.Logging; |
||||
|
using LINGYUN.Abp.Auditing.Security; |
||||
|
using Volo.Abp.AuditLogging; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Volo.Abp.Identity; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
public class AbpAuditingMapperProfile : Profile |
||||
|
{ |
||||
|
public AbpAuditingMapperProfile() |
||||
|
{ |
||||
|
CreateMap<AuditLogAction, AuditLogActionDto>() |
||||
|
.MapExtraProperties(); |
||||
|
CreateMap<EntityPropertyChange, EntityPropertyChangeDto>(); |
||||
|
CreateMap<EntityChange, EntityChangeDto>() |
||||
|
.MapExtraProperties(); |
||||
|
CreateMap<AuditLog, AuditLogDto>() |
||||
|
.MapExtraProperties(); |
||||
|
|
||||
|
CreateMap<IdentitySecurityLog, SecurityLogDto>(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,14 @@ |
|||||
|
using Volo.Abp.Application.Services; |
||||
|
using Volo.Abp.AuditLogging.Localization; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
public abstract class AuditingApplicationServiceBase : ApplicationService |
||||
|
{ |
||||
|
protected AuditingApplicationServiceBase() |
||||
|
{ |
||||
|
LocalizationResource = typeof(AuditLoggingResource); |
||||
|
ObjectMapperContext = typeof(AbpAuditingApplicationModule); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,53 @@ |
|||||
|
using LINGYUN.Abp.Auditing.Features; |
||||
|
using LINGYUN.Abp.Auditing.Permissions; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AuditLogging; |
||||
|
using Volo.Abp.Features; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
[Authorize(AuditingPermissionNames.AuditLog.Default)] |
||||
|
[RequiresFeature(AuditingFeatureNames.AuditLog.Default)] |
||||
|
public class AuditLogAppService : AuditingApplicationServiceBase, IAuditLogAppService |
||||
|
{ |
||||
|
protected IAuditLogRepository AuditLogRepository { get; } |
||||
|
|
||||
|
public AuditLogAppService(IAuditLogRepository auditLogRepository) |
||||
|
{ |
||||
|
AuditLogRepository = auditLogRepository; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<PagedResultDto<AuditLogDto>> GetListAsync(AuditLogGetByPagedDto input) |
||||
|
{ |
||||
|
var auditLogCount = await AuditLogRepository |
||||
|
.GetCountAsync(input.StartTime, input.EndTime, |
||||
|
input.HttpMethod, input.Url, input.UserName, input.ApplicationName, |
||||
|
input.CorrelationId, input.MaxExecutionDuration, input.MinExecutionDuration, |
||||
|
input.HasException, input.HttpStatusCode); |
||||
|
|
||||
|
var auditLog = await AuditLogRepository |
||||
|
.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, |
||||
|
input.StartTime, input.EndTime, |
||||
|
input.HttpMethod, input.Url, input.UserName, input.ApplicationName, |
||||
|
input.CorrelationId, input.MaxExecutionDuration, input.MinExecutionDuration, |
||||
|
input.HasException, input.HttpStatusCode, true); |
||||
|
|
||||
|
return new PagedResultDto<AuditLogDto>(auditLogCount, |
||||
|
ObjectMapper.Map<List<AuditLog>, List<AuditLogDto>>(auditLog)); |
||||
|
} |
||||
|
|
||||
|
[Authorize(AuditingPermissionNames.AuditLog.Delete)] |
||||
|
public virtual async Task DeleteAsync([Required] Guid id) |
||||
|
{ |
||||
|
var auditLog = await AuditLogRepository.GetAsync(id, false); |
||||
|
await AuditLogRepository.DeleteAsync(auditLog); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
using LINGYUN.Abp.Auditing.Features; |
||||
|
using LINGYUN.Abp.Auditing.Permissions; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Features; |
||||
|
using Volo.Abp.Identity; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Security |
||||
|
{ |
||||
|
[Authorize(AuditingPermissionNames.SecurityLog.Default)] |
||||
|
[RequiresFeature(AuditingFeatureNames.SecurityLog.Default)] |
||||
|
public class SecurityLogAppService : AuditingApplicationServiceBase, ISecurityLogAppService |
||||
|
{ |
||||
|
protected IIdentitySecurityLogRepository SecurityLogRepository { get; } |
||||
|
public SecurityLogAppService(IIdentitySecurityLogRepository securityLogRepository) |
||||
|
{ |
||||
|
SecurityLogRepository = securityLogRepository; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task<PagedResultDto<SecurityLogDto>> GetListAsync(SecurityLogGetByPagedDto input) |
||||
|
{ |
||||
|
var securityLogCount = await SecurityLogRepository |
||||
|
.GetCountAsync(input.StartTime, input.EndTime, |
||||
|
input.ApplicationName, input.Identity, input.ActionName, |
||||
|
input.UserId, input.UserName, input.ClientId, input.CorrelationId |
||||
|
); |
||||
|
|
||||
|
var securityLogs = await SecurityLogRepository |
||||
|
.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, |
||||
|
input.StartTime, input.EndTime, |
||||
|
input.ApplicationName, input.Identity, input.ActionName, |
||||
|
input.UserId, input.UserName, input.ClientId, input.CorrelationId |
||||
|
); |
||||
|
|
||||
|
return new PagedResultDto<SecurityLogDto>(securityLogCount, |
||||
|
ObjectMapper.Map<List<IdentitySecurityLog>, List<SecurityLogDto>>(securityLogs)); |
||||
|
} |
||||
|
|
||||
|
[Authorize(AuditingPermissionNames.SecurityLog.Delete)] |
||||
|
public virtual async Task DeleteAsync(Guid id) |
||||
|
{ |
||||
|
var securityLog = await SecurityLogRepository.GetAsync(id); |
||||
|
await SecurityLogRepository.DeleteAsync(securityLog); |
||||
|
|
||||
|
await CurrentUnitOfWork.SaveChangesAsync(); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,16 @@ |
|||||
|
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
|
||||
|
<PropertyGroup> |
||||
|
<TargetFramework>netcoreapp3.1</TargetFramework> |
||||
|
<RootNamespace /> |
||||
|
</PropertyGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<PackageReference Include="Volo.Abp.AspNetCore.Mvc" Version="3.1.0" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
<ItemGroup> |
||||
|
<ProjectReference Include="..\LINGYUN.Abp.Auditing.Application.Contracts\LINGYUN.Abp.Auditing.Application.Contracts.csproj" /> |
||||
|
</ItemGroup> |
||||
|
|
||||
|
</Project> |
||||
@ -0,0 +1,35 @@ |
|||||
|
using Localization.Resources.AbpUi; |
||||
|
using Microsoft.Extensions.DependencyInjection; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Volo.Abp.AuditLogging.Localization; |
||||
|
using Volo.Abp.Localization; |
||||
|
using Volo.Abp.Modularity; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing |
||||
|
{ |
||||
|
[DependsOn( |
||||
|
typeof(AbpAspNetCoreMvcModule), |
||||
|
typeof(AbpAuditingApplicationContractsModule))] |
||||
|
public class AbpAuditingHttpApiModule : AbpModule |
||||
|
{ |
||||
|
public override void PreConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
PreConfigure<IMvcBuilder>(mvcBuilder => |
||||
|
{ |
||||
|
mvcBuilder.AddApplicationPartIfNotExists(typeof(AbpAuditingHttpApiModule).Assembly); |
||||
|
}); |
||||
|
} |
||||
|
|
||||
|
public override void ConfigureServices(ServiceConfigurationContext context) |
||||
|
{ |
||||
|
Configure<AbpLocalizationOptions>(options => |
||||
|
{ |
||||
|
options.Resources |
||||
|
.Get<AuditLoggingResource>() |
||||
|
.AddBaseTypes( |
||||
|
typeof(AbpUiResource) |
||||
|
); |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Logging |
||||
|
{ |
||||
|
[RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("auditing")] |
||||
|
[ControllerName("audit-log")] |
||||
|
[Route("api/auditing/audit-log")] |
||||
|
public class AuditLogController : AbpController, IAuditLogAppService |
||||
|
{ |
||||
|
protected IAuditLogAppService AuditLogAppService { get; } |
||||
|
|
||||
|
public AuditLogController(IAuditLogAppService auditLogAppService) |
||||
|
{ |
||||
|
AuditLogAppService = auditLogAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
[Route("{id}")] |
||||
|
public virtual async Task DeleteAsync(Guid id) |
||||
|
{ |
||||
|
await AuditLogAppService.DeleteAsync(id); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
public virtual async Task<PagedResultDto<AuditLogDto>> GetListAsync(AuditLogGetByPagedDto input) |
||||
|
{ |
||||
|
return await AuditLogAppService.GetListAsync(input); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Auditing.Security |
||||
|
{ |
||||
|
[RemoteService(Name = AuditingRemoteServiceConsts.RemoteServiceName)] |
||||
|
[Area("auditing")] |
||||
|
[ControllerName("security-log")] |
||||
|
[Route("api/auditing/security-log")] |
||||
|
public class SecurityLogController : AbpController, ISecurityLogAppService |
||||
|
{ |
||||
|
protected ISecurityLogAppService SecurityLogAppService { get; } |
||||
|
|
||||
|
public SecurityLogController(ISecurityLogAppService securityLogAppService) |
||||
|
{ |
||||
|
SecurityLogAppService = securityLogAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpDelete] |
||||
|
[Route("{id}")] |
||||
|
public virtual async Task DeleteAsync(Guid id) |
||||
|
{ |
||||
|
await SecurityLogAppService.DeleteAsync(id); |
||||
|
} |
||||
|
|
||||
|
[HttpGet] |
||||
|
public virtual async Task<PagedResultDto<SecurityLogDto>> GetListAsync(SecurityLogGetByPagedDto input) |
||||
|
{ |
||||
|
return await SecurityLogAppService.GetListAsync(input); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,311 @@ |
|||||
|
<?xml version="1.0"?> |
||||
|
<doc> |
||||
|
<assembly> |
||||
|
<name>LINGYUN.Abp.EventBus.CAP</name> |
||||
|
</assembly> |
||||
|
<members> |
||||
|
<member name="T:DotNetCore.CAP.ConsumerServiceSelector"> |
||||
|
<summary> |
||||
|
消费者查找器 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.AbpDistributedEventBusOptions"> |
||||
|
<summary> |
||||
|
Abp分布式事件配置 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:DotNetCore.CAP.ConsumerServiceSelector.ServiceProvider"> |
||||
|
<summary> |
||||
|
服务提供者 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.#ctor(System.IServiceProvider,Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions})"> |
||||
|
<summary> |
||||
|
Creates a new <see cref="T:DotNetCore.CAP.Internal.ConsumerServiceSelector" />. |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.FindConsumersFromInterfaceTypes(System.IServiceProvider)"> |
||||
|
<summary> |
||||
|
查找消费者集合 |
||||
|
</summary> |
||||
|
<param name="provider"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.ConsumerServiceSelector.GetHandlerDescription(System.Type,System.Type)"> |
||||
|
<summary> |
||||
|
获取事件处理器集合 |
||||
|
</summary> |
||||
|
<param name="eventType"></param> |
||||
|
<param name="typeInfo"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="T:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker"> |
||||
|
<summary> |
||||
|
过期消息清理任务 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker.Options"> |
||||
|
<summary> |
||||
|
过期消息清理配置 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker.Initializer"> |
||||
|
<summary> |
||||
|
Initializer |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker.Storage"> |
||||
|
<summary> |
||||
|
Storage |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker.#ctor(Volo.Abp.Threading.AbpTimer,DotNetCore.CAP.Persistence.IDataStorage,DotNetCore.CAP.Persistence.IStorageInitializer,Microsoft.Extensions.Options.IOptions{LINGYUN.Abp.EventBus.CAP.MessageCleanupOptions},Microsoft.Extensions.DependencyInjection.IServiceScopeFactory)"> |
||||
|
<summary> |
||||
|
创建过期消息清理任务 |
||||
|
</summary> |
||||
|
<param name="timer"></param> |
||||
|
<param name="storage"></param> |
||||
|
<param name="initializer"></param> |
||||
|
<param name="options"></param> |
||||
|
<param name="serviceScopeFactory"></param> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapExpiresMessageCleanupBackgroundWorker.DoWorkAsync(Volo.Abp.BackgroundWorkers.PeriodicBackgroundWorkerContext)"> |
||||
|
<summary> |
||||
|
异步执行任务 |
||||
|
</summary> |
||||
|
<param name="workerContext"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="T:DotNetCore.CAP.Processor.AbpCapProcessingServer"> |
||||
|
<summary> |
||||
|
CapProcessingServer |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapProcessingServer.#ctor(Microsoft.Extensions.Logging.ILogger{DotNetCore.CAP.Processor.AbpCapProcessingServer},Microsoft.Extensions.Logging.ILoggerFactory,System.IServiceProvider)"> |
||||
|
<summary> |
||||
|
CapProcessingServer |
||||
|
</summary> |
||||
|
<param name="logger"></param> |
||||
|
<param name="loggerFactory"></param> |
||||
|
<param name="provider"></param> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapProcessingServer.Start"> |
||||
|
<summary> |
||||
|
Start |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapProcessingServer.Pulse"> |
||||
|
<summary> |
||||
|
Pulse |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:DotNetCore.CAP.Processor.AbpCapProcessingServer.Dispose"> |
||||
|
<summary> |
||||
|
Dispose |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusModule"> |
||||
|
<summary> |
||||
|
AbpCAPEventBusModule |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusModule.ConfigureServices(Volo.Abp.Modularity.ServiceConfigurationContext)"> |
||||
|
<summary> |
||||
|
ConfigureServices |
||||
|
</summary> |
||||
|
<param name="context"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPEventBusModule.OnApplicationInitialization(Volo.Abp.ApplicationInitializationContext)"> |
||||
|
<summary> |
||||
|
OnApplicationInitialization |
||||
|
</summary> |
||||
|
<param name="context"></param> |
||||
|
</member> |
||||
|
<member name="T:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException"> |
||||
|
<summary> |
||||
|
AbpECAPExecutionFailedException |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.MessageType"> |
||||
|
<summary> |
||||
|
MessageType |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.Origin"> |
||||
|
<summary> |
||||
|
Message |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message)"> |
||||
|
<summary> |
||||
|
constructor |
||||
|
</summary> |
||||
|
<param name="messageType"></param> |
||||
|
<param name="prigin"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String)"> |
||||
|
<summary> |
||||
|
constructor |
||||
|
</summary> |
||||
|
<param name="messageType"></param> |
||||
|
<param name="prigin"></param> |
||||
|
<param name="message"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.AbpCAPExecutionFailedException.#ctor(DotNetCore.CAP.Messages.MessageType,DotNetCore.CAP.Messages.Message,System.String,System.Exception)"> |
||||
|
<summary> |
||||
|
constructor |
||||
|
</summary> |
||||
|
<param name="messageType"></param> |
||||
|
<param name="prigin"></param> |
||||
|
<param name="message"></param> |
||||
|
<param name="innerException"></param> |
||||
|
</member> |
||||
|
<member name="T:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus"> |
||||
|
<summary> |
||||
|
CAP分布式事件总线 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.AbpDistributedEventBusOptions"> |
||||
|
<summary> |
||||
|
Abp分布式事件总线配置 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="F:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.CapPublisher"> |
||||
|
<summary> |
||||
|
CAP消息发布接口 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.CustomDistributedEventSubscriber"> |
||||
|
<summary> |
||||
|
自定义事件注册接口 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.HandlerFactories"> |
||||
|
<summary> |
||||
|
本地事件处理器工厂对象集合 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.EventTypes"> |
||||
|
<summary> |
||||
|
本地事件集合 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.#ctor(Microsoft.Extensions.DependencyInjection.IServiceScopeFactory,Microsoft.Extensions.Options.IOptions{Volo.Abp.EventBus.Distributed.AbpDistributedEventBusOptions},DotNetCore.CAP.ICapPublisher,Volo.Abp.MultiTenancy.ICurrentTenant,LINGYUN.Abp.EventBus.CAP.ICustomDistributedEventSubscriber)"> |
||||
|
<summary> |
||||
|
constructor |
||||
|
</summary> |
||||
|
<param name="serviceScopeFactory"></param> |
||||
|
<param name="distributedEventBusOptions"></param> |
||||
|
<param name="capPublisher"></param> |
||||
|
<param name="currentTenant"></param> |
||||
|
<param name="customDistributedEventSubscriber"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.Subscribe(System.Type,Volo.Abp.EventBus.IEventHandlerFactory)"> |
||||
|
<summary> |
||||
|
订阅事件 |
||||
|
</summary> |
||||
|
<param name="eventType"></param> |
||||
|
<param name="factory"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.Unsubscribe``1(System.Func{``0,System.Threading.Tasks.Task})"> |
||||
|
<summary> |
||||
|
退订事件 |
||||
|
</summary> |
||||
|
<typeparam name="TEvent">事件类型</typeparam> |
||||
|
<param name="action"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.Unsubscribe(System.Type,Volo.Abp.EventBus.IEventHandler)"> |
||||
|
<summary> |
||||
|
退订事件 |
||||
|
</summary> |
||||
|
<param name="eventType">事件类型</param> |
||||
|
<param name="handler">事件处理器</param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.Unsubscribe(System.Type,Volo.Abp.EventBus.IEventHandlerFactory)"> |
||||
|
<summary> |
||||
|
退订事件 |
||||
|
</summary> |
||||
|
<param name="eventType">事件类型</param> |
||||
|
<param name="factory">事件处理器工厂</param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.UnsubscribeAll(System.Type)"> |
||||
|
<summary> |
||||
|
退订所有事件 |
||||
|
</summary> |
||||
|
<param name="eventType">事件类型</param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.Subscribe``1(Volo.Abp.EventBus.Distributed.IDistributedEventHandler{``0})"> |
||||
|
<summary> |
||||
|
订阅事件 |
||||
|
</summary> |
||||
|
<typeparam name="TEvent">事件类型</typeparam> |
||||
|
<param name="handler">事件处理器</param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.PublishAsync(System.Type,System.Object)"> |
||||
|
<summary> |
||||
|
发布事件 |
||||
|
</summary> |
||||
|
<param name="eventType">事件类型</param> |
||||
|
<param name="eventData">事件数据对象</param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.CAPDistributedEventBus.GetHandlerFactories(System.Type)"> |
||||
|
<summary> |
||||
|
获取事件处理器工厂列表 |
||||
|
</summary> |
||||
|
<param name="eventType"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
<member name="T:LINGYUN.Abp.EventBus.CAP.ICustomDistributedEventSubscriber"> |
||||
|
<summary> |
||||
|
自定义事件订阅者 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.ICustomDistributedEventSubscriber.Subscribe(System.Type,Volo.Abp.EventBus.IEventHandlerFactory)"> |
||||
|
<summary> |
||||
|
订阅事件 |
||||
|
</summary> |
||||
|
<param name="eventType"></param> |
||||
|
<param name="factory"></param> |
||||
|
</member> |
||||
|
<member name="M:LINGYUN.Abp.EventBus.CAP.ICustomDistributedEventSubscriber.UnSubscribe(System.Type,Volo.Abp.EventBus.IEventHandlerFactory)"> |
||||
|
<summary> |
||||
|
取消订阅 |
||||
|
</summary> |
||||
|
<param name="eventType"></param> |
||||
|
<param name="factory"></param> |
||||
|
</member> |
||||
|
<member name="T:LINGYUN.Abp.EventBus.CAP.MessageCleanupOptions"> |
||||
|
<summary> |
||||
|
过期消息清理配置项 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.MessageCleanupOptions.ItemBatch"> |
||||
|
<summary> |
||||
|
批量清理数量 |
||||
|
default: 1000 |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="P:LINGYUN.Abp.EventBus.CAP.MessageCleanupOptions.Interval"> |
||||
|
<summary> |
||||
|
执行间隔(ms) |
||||
|
default: 3600000 (1 hours) |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="T:Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions"> |
||||
|
<summary> |
||||
|
CAP ServiceCollectionExtensions |
||||
|
</summary> |
||||
|
</member> |
||||
|
<member name="M:Microsoft.Extensions.DependencyInjection.ServiceCollectionExtensions.AddCAPEventBus(Microsoft.Extensions.DependencyInjection.IServiceCollection,System.Action{DotNetCore.CAP.CapOptions})"> |
||||
|
<summary> |
||||
|
Adds and configures the consistence services for the consistency. |
||||
|
</summary> |
||||
|
<param name="services"></param> |
||||
|
<param name="capAction"></param> |
||||
|
<returns></returns> |
||||
|
</member> |
||||
|
</members> |
||||
|
</doc> |
||||
@ -1,46 +0,0 @@ |
|||||
using LINGYUN.Abp.Location; |
|
||||
using Microsoft.AspNetCore.Mvc; |
|
||||
using System.Threading.Tasks; |
|
||||
using Volo.Abp.AspNetCore.Mvc; |
|
||||
|
|
||||
#if DEBUG
|
|
||||
namespace LINGYUN.Abp.BackendAdmin.Controllers |
|
||||
{ |
|
||||
[Route("Location")] |
|
||||
public class LocationController : AbpController |
|
||||
{ |
|
||||
protected ILocationResolveProvider LocationResolveProvider { get; } |
|
||||
|
|
||||
public LocationController( |
|
||||
ILocationResolveProvider locationResolveProvider) |
|
||||
{ |
|
||||
LocationResolveProvider = locationResolveProvider; |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
[Route("IpGeocode")] |
|
||||
public async Task<IPGecodeLocation> IPGeocodeAsync(string ipAddress) |
|
||||
{ |
|
||||
var location = await LocationResolveProvider.IPGeocodeAsync(ipAddress); |
|
||||
return location; |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
[Route("Geocode")] |
|
||||
public async Task<GecodeLocation> GeocodeAsync(string address) |
|
||||
{ |
|
||||
var location = await LocationResolveProvider.GeocodeAsync(address); |
|
||||
return location; |
|
||||
} |
|
||||
|
|
||||
[HttpGet] |
|
||||
[Route("ReGeocode")] |
|
||||
|
|
||||
public async Task<ReGeocodeLocation> ReGeocodeAsync(double lat, double lng, int redius = 50) |
|
||||
{ |
|
||||
var location = await LocationResolveProvider.ReGeocodeAsync(lat, lng); |
|
||||
return location; |
|
||||
} |
|
||||
} |
|
||||
} |
|
||||
#endif
|
|
||||
@ -0,0 +1,485 @@ |
|||||
|
// <auto-generated />
|
||||
|
using System; |
||||
|
using LINGYUN.Abp.BackendAdmin.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Microsoft.EntityFrameworkCore.Infrastructure; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; |
||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
|
||||
|
namespace LINGYUN.Abp.BackendAdmin.Migrations |
||||
|
{ |
||||
|
[DbContext(typeof(BackendAdminHostMigrationsDbContext))] |
||||
|
[Migration("20200928020134_Add-abp-audit-logging-module")] |
||||
|
partial class Addabpauditloggingmodule |
||||
|
{ |
||||
|
protected override void BuildTargetModel(ModelBuilder modelBuilder) |
||||
|
{ |
||||
|
#pragma warning disable 612, 618
|
||||
|
modelBuilder |
||||
|
.HasAnnotation("_Abp_DatabaseProvider", EfCoreDatabaseProvider.MySql) |
||||
|
.HasAnnotation("ProductVersion", "3.1.7") |
||||
|
.HasAnnotation("Relational:MaxIdentifierLength", 64); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLog", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ApplicationName") |
||||
|
.HasColumnName("ApplicationName") |
||||
|
.HasColumnType("varchar(96) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(96); |
||||
|
|
||||
|
b.Property<string>("BrowserInfo") |
||||
|
.HasColumnName("BrowserInfo") |
||||
|
.HasColumnType("varchar(512) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(512); |
||||
|
|
||||
|
b.Property<string>("ClientId") |
||||
|
.HasColumnName("ClientId") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ClientIpAddress") |
||||
|
.HasColumnName("ClientIpAddress") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ClientName") |
||||
|
.HasColumnName("ClientName") |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("Comments") |
||||
|
.HasColumnName("Comments") |
||||
|
.HasColumnType("varchar(256) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasColumnName("ConcurrencyStamp") |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(40); |
||||
|
|
||||
|
b.Property<string>("CorrelationId") |
||||
|
.HasColumnName("CorrelationId") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("Exceptions") |
||||
|
.HasColumnName("Exceptions") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(4000); |
||||
|
|
||||
|
b.Property<int>("ExecutionDuration") |
||||
|
.HasColumnName("ExecutionDuration") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<DateTime>("ExecutionTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnName("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<string>("HttpMethod") |
||||
|
.HasColumnName("HttpMethod") |
||||
|
.HasColumnType("varchar(16) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(16); |
||||
|
|
||||
|
b.Property<int?>("HttpStatusCode") |
||||
|
.HasColumnName("HttpStatusCode") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<Guid?>("ImpersonatorTenantId") |
||||
|
.HasColumnName("ImpersonatorTenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("ImpersonatorUserId") |
||||
|
.HasColumnName("ImpersonatorUserId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("TenantName") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<string>("Url") |
||||
|
.HasColumnName("Url") |
||||
|
.HasColumnType("varchar(256) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<Guid?>("UserId") |
||||
|
.HasColumnName("UserId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("UserName") |
||||
|
.HasColumnName("UserName") |
||||
|
.HasColumnType("varchar(256) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "ExecutionTime"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "UserId", "ExecutionTime"); |
||||
|
|
||||
|
b.ToTable("AbpAuditLogs"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid>("AuditLogId") |
||||
|
.HasColumnName("AuditLogId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<int>("ExecutionDuration") |
||||
|
.HasColumnName("ExecutionDuration") |
||||
|
.HasColumnType("int"); |
||||
|
|
||||
|
b.Property<DateTime>("ExecutionTime") |
||||
|
.HasColumnName("ExecutionTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnName("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<string>("MethodName") |
||||
|
.HasColumnName("MethodName") |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("Parameters") |
||||
|
.HasColumnName("Parameters") |
||||
|
.HasColumnType("varchar(2000) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(2000); |
||||
|
|
||||
|
b.Property<string>("ServiceName") |
||||
|
.HasColumnName("ServiceName") |
||||
|
.HasColumnType("varchar(256) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(256); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("AuditLogId"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "ServiceName", "MethodName", "ExecutionTime"); |
||||
|
|
||||
|
b.ToTable("AbpAuditLogActions"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid>("AuditLogId") |
||||
|
.HasColumnName("AuditLogId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<DateTime>("ChangeTime") |
||||
|
.HasColumnName("ChangeTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<byte>("ChangeType") |
||||
|
.HasColumnName("ChangeType") |
||||
|
.HasColumnType("tinyint unsigned"); |
||||
|
|
||||
|
b.Property<string>("EntityId") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("EntityId") |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<Guid?>("EntityTenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("EntityTypeFullName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("EntityTypeFullName") |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnName("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("AuditLogId"); |
||||
|
|
||||
|
b.HasIndex("TenantId", "EntityTypeFullName", "EntityId"); |
||||
|
|
||||
|
b.ToTable("AbpEntityChanges"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid>("EntityChangeId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("NewValue") |
||||
|
.HasColumnName("NewValue") |
||||
|
.HasColumnType("varchar(512) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(512); |
||||
|
|
||||
|
b.Property<string>("OriginalValue") |
||||
|
.HasColumnName("OriginalValue") |
||||
|
.HasColumnType("varchar(512) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(512); |
||||
|
|
||||
|
b.Property<string>("PropertyName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("PropertyName") |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("PropertyTypeFullName") |
||||
|
.IsRequired() |
||||
|
.HasColumnName("PropertyTypeFullName") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("EntityChangeId"); |
||||
|
|
||||
|
b.ToTable("AbpEntityPropertyChanges"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.FeatureManagement.FeatureValue", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpFeatureValues"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.PermissionManagement.PermissionGrant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<Guid?>("TenantId") |
||||
|
.HasColumnName("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpPermissionGrants"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.SettingManagement.Setting", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(128) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(128); |
||||
|
|
||||
|
b.Property<string>("ProviderKey") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("ProviderName") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(2048); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name", "ProviderName", "ProviderKey"); |
||||
|
|
||||
|
b.ToTable("AbpSettings"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.TenantManagement.Tenant", b => |
||||
|
{ |
||||
|
b.Property<Guid>("Id") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("ConcurrencyStamp") |
||||
|
.IsConcurrencyToken() |
||||
|
.HasColumnName("ConcurrencyStamp") |
||||
|
.HasColumnType("varchar(40) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(40); |
||||
|
|
||||
|
b.Property<DateTime>("CreationTime") |
||||
|
.HasColumnName("CreationTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<Guid?>("CreatorId") |
||||
|
.HasColumnName("CreatorId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<Guid?>("DeleterId") |
||||
|
.HasColumnName("DeleterId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<DateTime?>("DeletionTime") |
||||
|
.HasColumnName("DeletionTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<string>("ExtraProperties") |
||||
|
.HasColumnName("ExtraProperties") |
||||
|
.HasColumnType("longtext CHARACTER SET utf8mb4"); |
||||
|
|
||||
|
b.Property<bool>("IsDeleted") |
||||
|
.ValueGeneratedOnAdd() |
||||
|
.HasColumnName("IsDeleted") |
||||
|
.HasColumnType("tinyint(1)") |
||||
|
.HasDefaultValue(false); |
||||
|
|
||||
|
b.Property<DateTime?>("LastModificationTime") |
||||
|
.HasColumnName("LastModificationTime") |
||||
|
.HasColumnType("datetime(6)"); |
||||
|
|
||||
|
b.Property<Guid?>("LastModifierId") |
||||
|
.HasColumnName("LastModifierId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.HasKey("Id"); |
||||
|
|
||||
|
b.HasIndex("Name"); |
||||
|
|
||||
|
b.ToTable("AbpTenants"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => |
||||
|
{ |
||||
|
b.Property<Guid>("TenantId") |
||||
|
.HasColumnType("char(36)"); |
||||
|
|
||||
|
b.Property<string>("Name") |
||||
|
.HasColumnType("varchar(64) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(64); |
||||
|
|
||||
|
b.Property<string>("Value") |
||||
|
.IsRequired() |
||||
|
.HasColumnType("varchar(1024) CHARACTER SET utf8mb4") |
||||
|
.HasMaxLength(1024); |
||||
|
|
||||
|
b.HasKey("TenantId", "Name"); |
||||
|
|
||||
|
b.ToTable("AbpTenantConnectionStrings"); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.AuditLogAction", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) |
||||
|
.WithMany("Actions") |
||||
|
.HasForeignKey("AuditLogId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityChange", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.AuditLogging.AuditLog", null) |
||||
|
.WithMany("EntityChanges") |
||||
|
.HasForeignKey("AuditLogId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.AuditLogging.EntityPropertyChange", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.AuditLogging.EntityChange", null) |
||||
|
.WithMany("PropertyChanges") |
||||
|
.HasForeignKey("EntityChangeId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
|
||||
|
modelBuilder.Entity("Volo.Abp.TenantManagement.TenantConnectionString", b => |
||||
|
{ |
||||
|
b.HasOne("Volo.Abp.TenantManagement.Tenant", null) |
||||
|
.WithMany("ConnectionStrings") |
||||
|
.HasForeignKey("TenantId") |
||||
|
.OnDelete(DeleteBehavior.Cascade) |
||||
|
.IsRequired(); |
||||
|
}); |
||||
|
#pragma warning restore 612, 618
|
||||
|
} |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,166 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
namespace LINGYUN.Abp.BackendAdmin.Migrations |
||||
|
{ |
||||
|
public partial class Addabpauditloggingmodule : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpAuditLogs", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
ExtraProperties = table.Column<string>(nullable: true), |
||||
|
ConcurrencyStamp = table.Column<string>(maxLength: 40, nullable: true), |
||||
|
ApplicationName = table.Column<string>(maxLength: 96, nullable: true), |
||||
|
UserId = table.Column<Guid>(nullable: true), |
||||
|
UserName = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
TenantId = table.Column<Guid>(nullable: true), |
||||
|
TenantName = table.Column<string>(nullable: true), |
||||
|
ImpersonatorUserId = table.Column<Guid>(nullable: true), |
||||
|
ImpersonatorTenantId = table.Column<Guid>(nullable: true), |
||||
|
ExecutionTime = table.Column<DateTime>(nullable: false), |
||||
|
ExecutionDuration = table.Column<int>(nullable: false), |
||||
|
ClientIpAddress = table.Column<string>(maxLength: 64, nullable: true), |
||||
|
ClientName = table.Column<string>(maxLength: 128, nullable: true), |
||||
|
ClientId = table.Column<string>(maxLength: 64, nullable: true), |
||||
|
CorrelationId = table.Column<string>(maxLength: 64, nullable: true), |
||||
|
BrowserInfo = table.Column<string>(maxLength: 512, nullable: true), |
||||
|
HttpMethod = table.Column<string>(maxLength: 16, nullable: true), |
||||
|
Url = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
Exceptions = table.Column<string>(maxLength: 4000, nullable: true), |
||||
|
Comments = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
HttpStatusCode = table.Column<int>(nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpAuditLogs", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpAuditLogActions", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
TenantId = table.Column<Guid>(nullable: true), |
||||
|
AuditLogId = table.Column<Guid>(nullable: false), |
||||
|
ServiceName = table.Column<string>(maxLength: 256, nullable: true), |
||||
|
MethodName = table.Column<string>(maxLength: 128, nullable: true), |
||||
|
Parameters = table.Column<string>(maxLength: 2000, nullable: true), |
||||
|
ExecutionTime = table.Column<DateTime>(nullable: false), |
||||
|
ExecutionDuration = table.Column<int>(nullable: false), |
||||
|
ExtraProperties = table.Column<string>(nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpAuditLogActions", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpAuditLogActions_AbpAuditLogs_AuditLogId", |
||||
|
column: x => x.AuditLogId, |
||||
|
principalTable: "AbpAuditLogs", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpEntityChanges", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
AuditLogId = table.Column<Guid>(nullable: false), |
||||
|
TenantId = table.Column<Guid>(nullable: true), |
||||
|
ChangeTime = table.Column<DateTime>(nullable: false), |
||||
|
ChangeType = table.Column<byte>(nullable: false), |
||||
|
EntityTenantId = table.Column<Guid>(nullable: true), |
||||
|
EntityId = table.Column<string>(maxLength: 128, nullable: false), |
||||
|
EntityTypeFullName = table.Column<string>(maxLength: 128, nullable: false), |
||||
|
ExtraProperties = table.Column<string>(nullable: true) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpEntityChanges", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpEntityChanges_AbpAuditLogs_AuditLogId", |
||||
|
column: x => x.AuditLogId, |
||||
|
principalTable: "AbpAuditLogs", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "AbpEntityPropertyChanges", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(nullable: false), |
||||
|
TenantId = table.Column<Guid>(nullable: true), |
||||
|
EntityChangeId = table.Column<Guid>(nullable: false), |
||||
|
NewValue = table.Column<string>(maxLength: 512, nullable: true), |
||||
|
OriginalValue = table.Column<string>(maxLength: 512, nullable: true), |
||||
|
PropertyName = table.Column<string>(maxLength: 128, nullable: false), |
||||
|
PropertyTypeFullName = table.Column<string>(maxLength: 64, nullable: false) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_AbpEntityPropertyChanges", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_AbpEntityPropertyChanges_AbpEntityChanges_EntityChangeId", |
||||
|
column: x => x.EntityChangeId, |
||||
|
principalTable: "AbpEntityChanges", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpAuditLogActions_AuditLogId", |
||||
|
table: "AbpAuditLogActions", |
||||
|
column: "AuditLogId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpAuditLogActions_TenantId_ServiceName_MethodName_Execution~", |
||||
|
table: "AbpAuditLogActions", |
||||
|
columns: new[] { "TenantId", "ServiceName", "MethodName", "ExecutionTime" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpAuditLogs_TenantId_ExecutionTime", |
||||
|
table: "AbpAuditLogs", |
||||
|
columns: new[] { "TenantId", "ExecutionTime" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpAuditLogs_TenantId_UserId_ExecutionTime", |
||||
|
table: "AbpAuditLogs", |
||||
|
columns: new[] { "TenantId", "UserId", "ExecutionTime" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpEntityChanges_AuditLogId", |
||||
|
table: "AbpEntityChanges", |
||||
|
column: "AuditLogId"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpEntityChanges_TenantId_EntityTypeFullName_EntityId", |
||||
|
table: "AbpEntityChanges", |
||||
|
columns: new[] { "TenantId", "EntityTypeFullName", "EntityId" }); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_AbpEntityPropertyChanges_EntityChangeId", |
||||
|
table: "AbpEntityPropertyChanges", |
||||
|
column: "EntityChangeId"); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpAuditLogActions"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpEntityPropertyChanges"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpEntityChanges"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "AbpAuditLogs"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Binary file not shown.
@ -0,0 +1,128 @@ |
|||||
|
import { urlStringify, abpPagerFormat } from '@/utils/index' |
||||
|
import ApiService from './serviceBase' |
||||
|
import { PagedAndSortedResultRequestDto, PagedResultDto } from './types' |
||||
|
|
||||
|
const serviceUrl = process.env.VUE_APP_BASE_API |
||||
|
|
||||
|
export default class AuditingService { |
||||
|
public static getAuditLogs(payload: AuditLogGetPaged) { |
||||
|
let _url = '/api/auditing/audit-log?' |
||||
|
payload.skipCount = abpPagerFormat(payload.skipCount, payload.maxResultCount) |
||||
|
_url += urlStringify(payload) |
||||
|
return ApiService.Get<PagedResultDto<AuditLog>>(_url, serviceUrl) |
||||
|
} |
||||
|
|
||||
|
public static deleteAuditLog(id: string) { |
||||
|
const _url = '/api/auditing/audit-log/' + id |
||||
|
return ApiService.Delete(_url, serviceUrl) |
||||
|
} |
||||
|
|
||||
|
public static getSecurityLogs(payload: SecurityLogGetPaged) { |
||||
|
let _url = '/api/auditing/security-log?' |
||||
|
payload.skipCount = abpPagerFormat(payload.skipCount, payload.maxResultCount) |
||||
|
_url += urlStringify(payload) |
||||
|
return ApiService.Get<PagedResultDto<SecurityLog>>(_url, serviceUrl) |
||||
|
} |
||||
|
|
||||
|
public static deleteSecurityLog(id: string) { |
||||
|
const _url = '/api/auditing/security-log/' + id |
||||
|
return ApiService.Delete(_url, serviceUrl) |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
export class AuditLogGetPaged extends PagedAndSortedResultRequestDto { |
||||
|
startTime?: Date |
||||
|
endTime?: Date |
||||
|
httpMethod?: string |
||||
|
url?: string |
||||
|
userName?: string |
||||
|
correlationId?: string |
||||
|
applicationName?: string |
||||
|
maxExecutionDuration?: number |
||||
|
minExecutionDuration?: number |
||||
|
hasException?: boolean |
||||
|
httpStatusCode?: number |
||||
|
} |
||||
|
|
||||
|
export class SecurityLogGetPaged extends PagedAndSortedResultRequestDto { |
||||
|
startTime?: Date |
||||
|
endTime?: Date |
||||
|
applicationName?: string |
||||
|
identity?: string |
||||
|
actionName?: string |
||||
|
userId?: string |
||||
|
userName?: string |
||||
|
clientId?: string |
||||
|
correlationId?: string |
||||
|
} |
||||
|
|
||||
|
export class SecurityLog { |
||||
|
id!: string |
||||
|
applicationName?: string |
||||
|
identity?: string |
||||
|
action?: string |
||||
|
userId?: string |
||||
|
userName?: string |
||||
|
tenantName?: string |
||||
|
clientId?: string |
||||
|
correlationId?: string |
||||
|
clientIpAddress?: string |
||||
|
browserInfo?: string |
||||
|
creationTime?: Date |
||||
|
extraProperties?: {[key: string]: any} |
||||
|
} |
||||
|
|
||||
|
export class PropertyChange { |
||||
|
id!: string |
||||
|
newValue?: string |
||||
|
originalValue?: string |
||||
|
propertyName?: string |
||||
|
propertyTypeFullName?: string |
||||
|
} |
||||
|
|
||||
|
export class EntityChange { |
||||
|
id!: string |
||||
|
changeTime?: Date |
||||
|
changeType?: number |
||||
|
entityTenantId?: string |
||||
|
entityId?: string |
||||
|
entityTypeFullName?: string |
||||
|
propertyChanges?: PropertyChange[] |
||||
|
extraProperties?: {[key: string]: any} |
||||
|
} |
||||
|
|
||||
|
export class Action { |
||||
|
id!: string |
||||
|
serviceName?: string |
||||
|
methodName?: string |
||||
|
parameters?: string |
||||
|
executionTime?: Date |
||||
|
executionDuration?: number |
||||
|
extraProperties?: {[key: string]: any} |
||||
|
} |
||||
|
|
||||
|
export class AuditLog { |
||||
|
id!: string |
||||
|
applicationName?: string |
||||
|
userId?: string |
||||
|
userName?: string |
||||
|
tenantId?: string |
||||
|
tenantName?: string |
||||
|
impersonatorUserId?: string |
||||
|
impersonatorTenantId?: string |
||||
|
executionTime?: Date |
||||
|
executionDuration?: number |
||||
|
clientIpAddress?: string |
||||
|
clientName?: string |
||||
|
clientId?: string |
||||
|
correlationId?: string |
||||
|
browserInfo?: string |
||||
|
httpMethod?: string |
||||
|
url?: string |
||||
|
exceptions?: string |
||||
|
comments?: string |
||||
|
httpStatusCode?: number |
||||
|
entityChanges?: EntityChange[] |
||||
|
actions?: Action[] |
||||
|
extraProperties?: {[key: string]: any} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
/* eslint-disable */ |
||||
|
/* tslint:disable */ |
||||
|
// @ts-ignore
|
||||
|
import icon from 'vue-svgicon' |
||||
|
icon.register({ |
||||
|
'audit-log': { |
||||
|
width: 128, |
||||
|
height: 128, |
||||
|
viewBox: '0 0 1024 1024', |
||||
|
data: '<path pid="0" _fill="#333" d="M832 64c35.346 0 64 28.654 64 64v768c0 35.346-28.654 64-64 64H192c-35.346 0-64-28.654-64-64V128c0-35.346 28.654-64 64-64h640zm0 48H192c-8.837 0-16 7.163-16 16v768c0 8.837 7.163 16 16 16h640c8.837 0 16-7.163 16-16V128c0-8.837-7.163-16-16-16zM680 704c13.254 0 24 10.746 24 24s-10.746 24-24 24H344c-13.254 0-24-10.746-24-24s10.746-24 24-24h336zm0-160c13.254 0 24 10.746 24 24s-10.746 24-24 24H344c-13.254 0-24-10.746-24-24s10.746-24 24-24h336zm0-144c13.254 0 24 10.746 24 24s-10.746 24-24 24H344c-13.254 0-24-10.746-24-24s10.746-24 24-24h336zM488 256c13.254 0 24 10.746 24 24s-10.746 24-24 24H344c-13.254 0-24-10.746-24-24s10.746-24 24-24h144z"/>' |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,12 @@ |
|||||
|
/* eslint-disable */ |
||||
|
/* tslint:disable */ |
||||
|
// @ts-ignore
|
||||
|
import icon from 'vue-svgicon' |
||||
|
icon.register({ |
||||
|
'auditing': { |
||||
|
width: 128, |
||||
|
height: 128, |
||||
|
viewBox: '0 0 1024 1024', |
||||
|
data: '<path pid="0" _fill="#333" d="M834.2 829.9c77.7-95.4 72.2-236.2-16.8-325.1-47.5-47.5-109.6-71.2-171.8-71.2-62.2 0-124.4 23.7-171.8 71.2-94.9 94.9-94.9 248.8 0 343.7 47.4 47.4 109.6 71.2 171.8 71.2 54.4 0 108.7-18.1 153.3-54.4l99.9 99.9 35.4-35.4-100-99.9zm-38.7-31.6l-12.6 15.5-15.5 12.6c-17.3 14.1-36.8 25-57.8 32.4-20.5 7.2-42 10.8-63.8 10.8-51.6 0-100-20.1-136.5-56.5-36.5-36.5-56.5-84.9-56.5-136.5 0-51.6 20.1-100 56.5-136.5 36.5-36.5 84.9-56.5 136.5-56.5 51.6 0 100 20.1 136.5 56.5 34 34 54 79.2 56.3 127.1 2.1 47.8-13.2 94.3-43.1 131.1zM239.9 371h210v50h-210z"/><path pid="1" _fill="#333" d="M139.9 128.9h156.3v74.3h50v-74.3h123.7v74.3h50v-74.3h123.8v74.3h50v-74.3h156.2V399h50V78.9h-810V907h270.3v-50H139.9z"/><path pid="2" _fill="#333" d="M239.9 563.3h120.3v50H239.9z"/>' |
||||
|
} |
||||
|
}) |
||||
@ -0,0 +1,12 @@ |
|||||
|
/* eslint-disable */ |
||||
|
/* tslint:disable */ |
||||
|
// @ts-ignore
|
||||
|
import icon from 'vue-svgicon' |
||||
|
icon.register({ |
||||
|
'security-log': { |
||||
|
width: 128, |
||||
|
height: 128, |
||||
|
viewBox: '0 0 1024 1024', |
||||
|
data: '<path pid="0" _fill="#333" d="M515.038 68.496c-98.858 1.251-59.037 75.835-346.991 77.109v443.378c0 191.637 302.412 366.268 346.991 366.268S862.029 780.62 862.029 588.983V145.605c-283.135.532-251.74-78.314-346.991-77.109zM823.474 590.24c0 153.941-286.85 326.258-308.437 326.457-21.492.199-307.232-173.721-308.437-326.457V195.055c255.96-1.135 220.563-67.613 308.437-68.727 84.668-1.074 56.76 69.202 308.437 68.727V590.24zM382.718 463.68c-7.528-7.528-19.734-7.528-27.262 0-7.528 7.528-7.528 19.734 0 27.262l122.681 122.681c7.528 7.528 19.734 7.528 27.262 0l207.774-207.774c7.528-7.528 7.528-19.734 0-27.262-7.528-7.528-19.734-7.528-27.262 0L491.768 572.73l-109.05-109.05z"/>' |
||||
|
} |
||||
|
}) |
||||
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 934 B |
@ -0,0 +1,37 @@ |
|||||
|
import { RouteConfig } from 'vue-router' |
||||
|
import Layout from '@/layout/index.vue' |
||||
|
|
||||
|
const auditingRouter: RouteConfig = { |
||||
|
path: '/auditing', |
||||
|
component: Layout, |
||||
|
meta: { |
||||
|
title: 'auditing', |
||||
|
icon: 'auditing', |
||||
|
roles: ['AbpAuditing.AuditLog', 'AbpAuditing.SecurityLog'], // you can set roles in root nav
|
||||
|
alwaysShow: true // will always show the root menu
|
||||
|
}, |
||||
|
children: [ |
||||
|
{ |
||||
|
path: 'audit-log', |
||||
|
component: () => import(/* webpackChunkName: "settings" */ '@/views/admin/auditing/audit-log/index.vue'), |
||||
|
name: 'auditLog', |
||||
|
meta: { |
||||
|
title: 'auditLog', |
||||
|
icon: 'audit-log', |
||||
|
roles: ['AbpAuditing.AuditLog'] |
||||
|
} |
||||
|
}, |
||||
|
{ |
||||
|
path: 'security-log', |
||||
|
component: () => import(/* webpackChunkName: "users" */ '@/views/admin/auditing/security-log/index.vue'), |
||||
|
name: 'securityLog', |
||||
|
meta: { |
||||
|
title: 'securityLog', |
||||
|
icon: 'security-log', |
||||
|
roles: ['AbpAuditing.SecurityLog'] |
||||
|
} |
||||
|
} |
||||
|
] |
||||
|
} |
||||
|
|
||||
|
export default auditingRouter |
||||
@ -0,0 +1,38 @@ |
|||||
|
<template> |
||||
|
<el-dialog |
||||
|
:visible="showDialog" |
||||
|
title="审计日志" |
||||
|
width="800px" |
||||
|
:close-on-click-modal="true" |
||||
|
@close="onFormClosed" |
||||
|
> |
||||
|
<audit-log-profile :audit-log="auditLog" /> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { AuditLog } from '@/api/auditing' |
||||
|
import { Component, Vue, Prop } from 'vue-property-decorator' |
||||
|
import AuditLogProfile from './AuditLogProfile.vue' |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'AuditLogDialog', |
||||
|
components: { |
||||
|
AuditLogProfile |
||||
|
} |
||||
|
}) |
||||
|
export default class extends Vue { |
||||
|
@Prop({ default: false }) |
||||
|
private showDialog!: boolean |
||||
|
|
||||
|
@Prop({ |
||||
|
default: () => { return {} } |
||||
|
}) |
||||
|
private auditLog!: AuditLog |
||||
|
|
||||
|
private onFormClosed() { |
||||
|
console.log('关闭窗口') |
||||
|
this.$emit('closed') |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,283 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-form label-width="100px"> |
||||
|
<el-tabs v-model="activedTabItem"> |
||||
|
<el-tab-pane |
||||
|
label="应用信息" |
||||
|
name="application" |
||||
|
> |
||||
|
<el-form-item label="应用名称"> |
||||
|
<el-input |
||||
|
v-model="auditLog.applicationName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="租户标识"> |
||||
|
<el-input |
||||
|
v-model="auditLog.tenantId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="租户名称"> |
||||
|
<el-input |
||||
|
v-model="auditLog.tenantName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item |
||||
|
v-if="auditLog.impersonatorTenantId !== null" |
||||
|
label="模拟租户" |
||||
|
> |
||||
|
<el-input |
||||
|
v-model="auditLog.impersonatorTenantId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
label="用户信息" |
||||
|
name="userInfo" |
||||
|
> |
||||
|
<el-form-item label="用户标识"> |
||||
|
<el-input |
||||
|
v-model="auditLog.userId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item |
||||
|
v-if="auditLog.impersonatorUserId !== null" |
||||
|
label="模拟用户" |
||||
|
> |
||||
|
<el-input |
||||
|
v-model="auditLog.impersonatorUserId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户名称"> |
||||
|
<el-input |
||||
|
v-model="auditLog.userName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端标识"> |
||||
|
<el-input |
||||
|
v-model="auditLog.clientId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端名称"> |
||||
|
<el-input |
||||
|
v-model="auditLog.clientName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端地址"> |
||||
|
<el-input |
||||
|
v-model="auditLog.clientIpAddress" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="浏览器信息"> |
||||
|
<el-input |
||||
|
v-model="auditLog.browserInfo" |
||||
|
type="textarea" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
label="操作信息" |
||||
|
name="operation" |
||||
|
> |
||||
|
<el-form-item label="请求路径"> |
||||
|
<el-input |
||||
|
v-model="auditLog.url" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="操作方法"> |
||||
|
<el-input |
||||
|
v-model="auditLog.httpMethod" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="调用时间"> |
||||
|
<el-input |
||||
|
:value="getFormatDateTime(auditLog.executionTime)" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="响应时间"> |
||||
|
<el-input |
||||
|
v-model="auditLog.executionDuration" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="响应状态"> |
||||
|
<el-input |
||||
|
v-model="auditLog.httpStatusCode" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="调用链标识"> |
||||
|
<el-input |
||||
|
v-model="auditLog.correlationId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
label="调用方法" |
||||
|
name="methodInvoke" |
||||
|
style="height:300px;overflow-y:auto;overflow-x:hidden;" |
||||
|
> |
||||
|
<el-timeline> |
||||
|
<el-timeline-item |
||||
|
v-for="(action, index) in getActions" |
||||
|
:key="index" |
||||
|
:timestamp="getFormatDateTime(action.executionTime)" |
||||
|
:type="auditLog.httpStatusCode | httpStatusCodeFilter" |
||||
|
placement="top" |
||||
|
> |
||||
|
<el-card> |
||||
|
<el-form-item label="调用服务"> |
||||
|
<el-input |
||||
|
v-model="action.serviceName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="方法名称"> |
||||
|
<el-input |
||||
|
v-model="action.methodName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="响应时间"> |
||||
|
<el-input |
||||
|
v-model="action.executionDuration" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="参数列表"> |
||||
|
<json-editor |
||||
|
:value="getFormatJsonValue(action.parameters)" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-card> |
||||
|
</el-timeline-item> |
||||
|
</el-timeline> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
v-if="hasException" |
||||
|
label="异常信息" |
||||
|
name="exception" |
||||
|
> |
||||
|
<el-form-item label="异常堆栈"> |
||||
|
<el-input |
||||
|
v-model="auditLog.exceptions" |
||||
|
type="textarea" |
||||
|
:rows="15" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
v-if="hasExtraProperties" |
||||
|
label="附加信息" |
||||
|
name="extraProperties" |
||||
|
> |
||||
|
<el-form-item |
||||
|
v-for="(key, index) in Object.keys(auditLog.extraProperties)" |
||||
|
:key="index" |
||||
|
:label="key" |
||||
|
> |
||||
|
<el-input |
||||
|
v-model="auditLog.extraProperties[key]" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { Component, Vue, Prop, Watch } from 'vue-property-decorator' |
||||
|
import { Action, AuditLog } from '@/api/auditing' |
||||
|
import { dateFormat } from '@/utils' |
||||
|
import JsonEditor from '@/components/JsonEditor/index.vue' |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'AuditLogProfile', |
||||
|
components: { |
||||
|
JsonEditor |
||||
|
}, |
||||
|
filters: { |
||||
|
httpStatusCodeFilter(httpStatusCode: number) { |
||||
|
if (httpStatusCode >= 200 && httpStatusCode < 300) { |
||||
|
return 'success' |
||||
|
} |
||||
|
if (httpStatusCode >= 300 && httpStatusCode < 500) { |
||||
|
return 'warning' |
||||
|
} |
||||
|
if (httpStatusCode >= 500) { |
||||
|
return 'danger' |
||||
|
} |
||||
|
return 'primary' |
||||
|
} |
||||
|
}, |
||||
|
computed: { |
||||
|
getFormatDateTime() { |
||||
|
return (dateTime: any) => { |
||||
|
return dateFormat(new Date(dateTime), 'YYYY-mm-dd HH:MM:SS:NS') |
||||
|
} |
||||
|
}, |
||||
|
getFormatJsonValue() { |
||||
|
return (jsonString: string) => { |
||||
|
if (jsonString !== '') { |
||||
|
return JSON.parse(jsonString) |
||||
|
} |
||||
|
return null |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
export default class extends Vue { |
||||
|
@Prop({ |
||||
|
default: () => { return {} } |
||||
|
}) |
||||
|
private auditLog!: AuditLog |
||||
|
|
||||
|
private activedTabItem = 'application' |
||||
|
|
||||
|
@Watch('auditLog') |
||||
|
private onAuditLogChanged() { |
||||
|
this.activedTabItem = 'application' |
||||
|
} |
||||
|
|
||||
|
get hasExtraProperties() { |
||||
|
if (this.auditLog.extraProperties) { |
||||
|
return Object.keys(this.auditLog.extraProperties).length > 0 |
||||
|
} |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
get hasException() { |
||||
|
if (this.auditLog.exceptions) { |
||||
|
return true |
||||
|
} |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
get getActions() { |
||||
|
if (this.auditLog.actions && this.auditLog.actions.length > 0) { |
||||
|
return this.auditLog.actions.reverse() |
||||
|
} |
||||
|
return new Array<Action>() |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
</style> |
||||
@ -0,0 +1,368 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div class="filter-container"> |
||||
|
<el-card> |
||||
|
<el-collapse> |
||||
|
<el-collapse-item> |
||||
|
<template slot="title"> |
||||
|
<span class="data-filter-collapse-title">查询条件</span> |
||||
|
</template> |
||||
|
<el-form label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="应用名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.applicationName" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="用户名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.userName" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="请求方法"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.httpMethod" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item label="请求路径"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.url" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="响应状态"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.httpStatusCode" |
||||
|
type="number" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="6"> |
||||
|
<el-form-item label="包含异常"> |
||||
|
<el-switch |
||||
|
v-model="dataFilter.hasException" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="18"> |
||||
|
<el-form-item label="调用链"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.correlationId" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="最短响应时间"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.minExecutionDuration" |
||||
|
type="number" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="最长响应时间"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.maxExecutionDuration" |
||||
|
type="number" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="开始时间"> |
||||
|
<el-date-picker |
||||
|
v-model="dataFilter.startTime" |
||||
|
placeholder="选择日期时间" |
||||
|
type="datetime" |
||||
|
default-time="00:00:00" |
||||
|
style="width: 100%" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="结束时间"> |
||||
|
<el-date-picker |
||||
|
v-model="dataFilter.endTime" |
||||
|
placeholder="选择日期时间" |
||||
|
type="datetime" |
||||
|
default-time="23:59:59" |
||||
|
style="width: 100%" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-button |
||||
|
class="filter-item" |
||||
|
style="display:block;margin:0 auto; width: 150px;" |
||||
|
type="primary" |
||||
|
@click="refreshPagedData" |
||||
|
> |
||||
|
<i class="el-icon-search" /> |
||||
|
查询日志 |
||||
|
</el-button> |
||||
|
</el-form> |
||||
|
</el-collapse-item> |
||||
|
</el-collapse> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
<el-table |
||||
|
v-loading="dataLoading" |
||||
|
row-key="itemId" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
fit |
||||
|
highlight-current-row |
||||
|
style="width: 100%;" |
||||
|
@sort-change="handleSortChange" |
||||
|
@row-dblclick="onRowDoubleClicked" |
||||
|
> |
||||
|
<el-table-column |
||||
|
label="应用程序" |
||||
|
prop="applicationName" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.applicationName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="请求路径" |
||||
|
prop="url" |
||||
|
sortable |
||||
|
width="250px" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<el-tag> |
||||
|
{{ row.url }} |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="状态码" |
||||
|
prop="httpStatusCode" |
||||
|
sortable |
||||
|
width="100px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<el-tag |
||||
|
:type="row.httpStatusCode | httpStatusCodeFilter" |
||||
|
> |
||||
|
{{ row.httpStatusCode }} |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="操作用户" |
||||
|
prop="userName" |
||||
|
sortable |
||||
|
width="150px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.userName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端标识" |
||||
|
prop="clientId" |
||||
|
sortable |
||||
|
width="150px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientId }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端名称" |
||||
|
prop="clientName" |
||||
|
sortable |
||||
|
width="150px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端地址" |
||||
|
prop="clientIpAddress" |
||||
|
sortable |
||||
|
width="150px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientIpAddress }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="操作方法" |
||||
|
prop="httpMethod" |
||||
|
sortable |
||||
|
width="150px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<el-tag |
||||
|
:type="row.httpMethod | httpMethodFilter" |
||||
|
> |
||||
|
{{ row.httpMethod }} |
||||
|
</el-tag> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
:label="$t('operaActions')" |
||||
|
align="center" |
||||
|
width="250px" |
||||
|
fixed="right" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<el-button |
||||
|
:disabled="!checkPermission(['Abp.Auditing.AuditLog'])" |
||||
|
size="mini" |
||||
|
type="primary" |
||||
|
@click="handleShowAuditLogDialog(row)" |
||||
|
> |
||||
|
查看日志 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
:disabled="!checkPermission(['Abp.Auditing.AuditLog.Delete'])" |
||||
|
size="mini" |
||||
|
type="danger" |
||||
|
@click="handleDeleteAuditLog(row.id)" |
||||
|
> |
||||
|
删除日志 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="dataTotal>0" |
||||
|
:total="dataTotal" |
||||
|
:page.sync="dataFilter.skipCount" |
||||
|
:limit.sync="dataFilter.maxResultCount" |
||||
|
@pagination="refreshPagedData" |
||||
|
@sort-change="handleSortChange" |
||||
|
/> |
||||
|
|
||||
|
<audit-log-dialog |
||||
|
:audit-log="auditLog" |
||||
|
:show-dialog="showAuditLog" |
||||
|
@closed="onAuditLogDialogClosed" |
||||
|
/> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { checkPermission } from '@/utils/permission' |
||||
|
import AuditingService, { AuditLog, AuditLogGetPaged } from '@/api/auditing' |
||||
|
import DataListMiXin from '@/mixins/DataListMiXin' |
||||
|
import Component, { mixins } from 'vue-class-component' |
||||
|
import Pagination from '@/components/Pagination/index.vue' |
||||
|
import AuditLogDialog from './components/AuditLogDialog.vue' |
||||
|
|
||||
|
const statusMap: { [key: string]: string } = { |
||||
|
GET: '', |
||||
|
POST: 'success', |
||||
|
PUT: 'warning', |
||||
|
PATCH: 'warning', |
||||
|
DELETE: 'danger' |
||||
|
} |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'AuditLog', |
||||
|
components: { |
||||
|
Pagination, |
||||
|
AuditLogDialog |
||||
|
}, |
||||
|
filters: { |
||||
|
httpMethodFilter(httpMethod: string) { |
||||
|
return statusMap[httpMethod] |
||||
|
}, |
||||
|
httpStatusCodeFilter(httpStatusCode: number) { |
||||
|
if (httpStatusCode >= 200 && httpStatusCode < 300) { |
||||
|
return 'success' |
||||
|
} |
||||
|
if (httpStatusCode >= 300 && httpStatusCode < 500) { |
||||
|
return 'warning' |
||||
|
} |
||||
|
if (httpStatusCode >= 500) { |
||||
|
return 'danger' |
||||
|
} |
||||
|
return '' |
||||
|
} |
||||
|
}, |
||||
|
methods: { |
||||
|
checkPermission |
||||
|
} |
||||
|
}) |
||||
|
export default class extends mixins(DataListMiXin) { |
||||
|
private auditLog = new AuditLog() |
||||
|
|
||||
|
private showAuditLog = false |
||||
|
public dataFilter = new AuditLogGetPaged() |
||||
|
|
||||
|
mounted() { |
||||
|
this.refreshPagedData() |
||||
|
} |
||||
|
|
||||
|
protected getPagedList(filter: any) { |
||||
|
return AuditingService.getAuditLogs(filter) |
||||
|
} |
||||
|
|
||||
|
private handleShowAuditLogDialog(auditLog: AuditLog) { |
||||
|
this.auditLog = auditLog |
||||
|
this.showAuditLog = true |
||||
|
} |
||||
|
|
||||
|
private handleDeleteAuditLog(id: string) { |
||||
|
this.$confirm('是否要删除选定的审计日志记录?', |
||||
|
'删除审计日志', { |
||||
|
callback: (action) => { |
||||
|
if (action === 'confirm') { |
||||
|
AuditingService.deleteAuditLog(id).then(() => { |
||||
|
this.$message.success('删除成功!') |
||||
|
this.refreshPagedData() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
private onRowDoubleClicked(row: AuditLog) { |
||||
|
this.handleShowAuditLogDialog(row) |
||||
|
} |
||||
|
|
||||
|
private onAuditLogDialogClosed() { |
||||
|
this.showAuditLog = false |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.data-filter-collapse-title { |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
</style> |
||||
@ -0,0 +1,37 @@ |
|||||
|
<template> |
||||
|
<el-dialog |
||||
|
:visible="showDialog" |
||||
|
title="安全日志" |
||||
|
width="800px" |
||||
|
:close-on-click-modal="true" |
||||
|
@close="onFormClosed" |
||||
|
> |
||||
|
<security-log-profile :security-log="securityLog" /> |
||||
|
</el-dialog> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { SecurityLog } from '@/api/auditing' |
||||
|
import { Component, Vue, Prop } from 'vue-property-decorator' |
||||
|
import SecurityLogProfile from './SecurityLogProfile.vue' |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'SecurityLogDialog', |
||||
|
components: { |
||||
|
SecurityLogProfile |
||||
|
} |
||||
|
}) |
||||
|
export default class extends Vue { |
||||
|
@Prop({ default: false }) |
||||
|
private showDialog!: boolean |
||||
|
|
||||
|
@Prop({ |
||||
|
default: () => { return {} } |
||||
|
}) |
||||
|
private securityLog!: SecurityLog |
||||
|
|
||||
|
private onFormClosed() { |
||||
|
this.$emit('closed') |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
@ -0,0 +1,146 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<el-form label-width="100px"> |
||||
|
<el-tabs v-model="activedTabItem"> |
||||
|
<el-tab-pane |
||||
|
label="应用信息" |
||||
|
name="application" |
||||
|
> |
||||
|
<el-form-item label="应用名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.applicationName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="租户名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.tenantName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
label="用户信息" |
||||
|
name="userInfo" |
||||
|
> |
||||
|
<el-form-item label="用户标识"> |
||||
|
<el-input |
||||
|
v-model="securityLog.userId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="用户名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.userName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端标识"> |
||||
|
<el-input |
||||
|
v-model="securityLog.clientId" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.clientName" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="客户端地址"> |
||||
|
<el-input |
||||
|
v-model="securityLog.clientIpAddress" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="浏览器信息"> |
||||
|
<el-input |
||||
|
v-model="securityLog.browserInfo" |
||||
|
type="textarea" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
label="操作信息" |
||||
|
name="operation" |
||||
|
> |
||||
|
<el-form-item label="主体名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.identity" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="方法名称"> |
||||
|
<el-input |
||||
|
v-model="securityLog.action" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="创建时间"> |
||||
|
<el-input |
||||
|
:value="getFormatDateTime(securityLog.creationTime)" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
<el-tab-pane |
||||
|
v-if="hasExtraProperties" |
||||
|
label="附加信息" |
||||
|
name="extraProperties" |
||||
|
> |
||||
|
<el-form-item |
||||
|
v-for="(key, index) in Object.keys(securityLog.extraProperties)" |
||||
|
:key="index" |
||||
|
:label="key" |
||||
|
> |
||||
|
<el-input |
||||
|
v-model="securityLog.extraProperties[key]" |
||||
|
readonly |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</el-form> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { Component, Vue, Prop, Watch } from 'vue-property-decorator' |
||||
|
import { SecurityLog } from '@/api/auditing' |
||||
|
import { dateFormat } from '@/utils' |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'SecurityLogProfile', |
||||
|
computed: { |
||||
|
getFormatDateTime() { |
||||
|
return (dateTime: any) => { |
||||
|
return dateFormat(new Date(dateTime), 'YYYY-mm-dd HH:MM:SS:NS') |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
export default class extends Vue { |
||||
|
@Prop({ |
||||
|
default: () => { return {} } |
||||
|
}) |
||||
|
private securityLog!: SecurityLog |
||||
|
|
||||
|
private activedTabItem = 'application' |
||||
|
|
||||
|
get hasExtraProperties() { |
||||
|
if (this.securityLog.extraProperties) { |
||||
|
return Object.keys(this.securityLog.extraProperties).length > 0 |
||||
|
} |
||||
|
return false |
||||
|
} |
||||
|
|
||||
|
@Watch('securityLog') |
||||
|
private onSecurityLogChanged() { |
||||
|
this.activedTabItem = 'application' |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
</style> |
||||
@ -0,0 +1,304 @@ |
|||||
|
<template> |
||||
|
<div class="app-container"> |
||||
|
<div class="filter-container"> |
||||
|
<el-card> |
||||
|
<el-collapse> |
||||
|
<el-collapse-item> |
||||
|
<template slot="title"> |
||||
|
<span class="data-filter-collapse-title">查询条件</span> |
||||
|
</template> |
||||
|
<el-form label-width="100px"> |
||||
|
<el-row> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="应用名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.applicationName" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="用户名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.userName" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="客户端标识"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.clientId" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="16"> |
||||
|
<el-form-item label="主体名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.identity" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="8"> |
||||
|
<el-form-item label="方法名称"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.actionName" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="客户端标识"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.clientId" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="调用链"> |
||||
|
<el-input |
||||
|
v-model="dataFilter.correlationId" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-row> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="开始时间"> |
||||
|
<el-date-picker |
||||
|
v-model="dataFilter.startTime" |
||||
|
placeholder="选择日期时间" |
||||
|
type="datetime" |
||||
|
default-time="00:00:00" |
||||
|
style="width: 100%" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
<el-col :span="12"> |
||||
|
<el-form-item label="结束时间"> |
||||
|
<el-date-picker |
||||
|
v-model="dataFilter.endTime" |
||||
|
placeholder="选择日期时间" |
||||
|
type="datetime" |
||||
|
default-time="23:59:59" |
||||
|
style="width: 100%" |
||||
|
value-format="yyyy-MM-dd HH:mm:ss" |
||||
|
/> |
||||
|
</el-form-item> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
<el-button |
||||
|
class="filter-item" |
||||
|
style="display:block;margin:0 auto; width: 150px;" |
||||
|
type="primary" |
||||
|
@click="refreshPagedData" |
||||
|
> |
||||
|
<i class="el-icon-search" /> |
||||
|
查询日志 |
||||
|
</el-button> |
||||
|
</el-form> |
||||
|
</el-collapse-item> |
||||
|
</el-collapse> |
||||
|
</el-card> |
||||
|
</div> |
||||
|
|
||||
|
<el-table |
||||
|
v-loading="dataLoading" |
||||
|
row-key="itemId" |
||||
|
:data="dataList" |
||||
|
border |
||||
|
fit |
||||
|
highlight-current-row |
||||
|
style="width: 100%;" |
||||
|
@sort-change="handleSortChange" |
||||
|
@row-dblclick="onRowDoubleClicked" |
||||
|
> |
||||
|
<el-table-column |
||||
|
label="应用程序" |
||||
|
prop="applicationName" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.applicationName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="操作用户" |
||||
|
prop="userName" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.userName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端标识" |
||||
|
prop="clientId" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientId }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端名称" |
||||
|
prop="clientName" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientName }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="客户端地址" |
||||
|
prop="clientIpAddress" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.clientIpAddress }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="认证服务器" |
||||
|
prop="identity" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.identity }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
label="方法名称" |
||||
|
prop="action" |
||||
|
sortable |
||||
|
width="200px" |
||||
|
align="center" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<span>{{ row.action }}</span> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
<el-table-column |
||||
|
:label="$t('operaActions')" |
||||
|
align="center" |
||||
|
width="250px" |
||||
|
fixed="right" |
||||
|
> |
||||
|
<template slot-scope="{row}"> |
||||
|
<el-button |
||||
|
:disabled="!checkPermission(['Abp.Auditing.SecurityLog'])" |
||||
|
size="mini" |
||||
|
type="primary" |
||||
|
@click="handleShowSecurityLogDialog(row)" |
||||
|
> |
||||
|
查看日志 |
||||
|
</el-button> |
||||
|
<el-button |
||||
|
:disabled="!checkPermission(['Abp.Auditing.SecurityLog.Delete'])" |
||||
|
size="mini" |
||||
|
type="danger" |
||||
|
@click="handleDeleteSecurityLog(row.id)" |
||||
|
> |
||||
|
删除日志 |
||||
|
</el-button> |
||||
|
</template> |
||||
|
</el-table-column> |
||||
|
</el-table> |
||||
|
|
||||
|
<pagination |
||||
|
v-show="dataTotal>0" |
||||
|
:total="dataTotal" |
||||
|
:page.sync="dataFilter.skipCount" |
||||
|
:limit.sync="dataFilter.maxResultCount" |
||||
|
@pagination="refreshPagedData" |
||||
|
@sort-change="handleSortChange" |
||||
|
/> |
||||
|
|
||||
|
<security-log-dialog |
||||
|
:security-log="securityLog" |
||||
|
:show-dialog="showSecurityLog" |
||||
|
@closed="onSecurityLogDialogClosed" |
||||
|
/> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { checkPermission } from '@/utils/permission' |
||||
|
import AuditingService, { SecurityLog, SecurityLogGetPaged } from '@/api/auditing' |
||||
|
import DataListMiXin from '@/mixins/DataListMiXin' |
||||
|
import Component, { mixins } from 'vue-class-component' |
||||
|
import Pagination from '@/components/Pagination/index.vue' |
||||
|
import SecurityLogDialog from './components/SecurityLogDialog.vue' |
||||
|
|
||||
|
@Component({ |
||||
|
name: 'SecurityLog', |
||||
|
components: { |
||||
|
Pagination, |
||||
|
SecurityLogDialog |
||||
|
}, |
||||
|
methods: { |
||||
|
checkPermission |
||||
|
} |
||||
|
}) |
||||
|
export default class extends mixins(DataListMiXin) { |
||||
|
private securityLog = new SecurityLog() |
||||
|
|
||||
|
private showSecurityLog = false |
||||
|
public dataFilter = new SecurityLogGetPaged() |
||||
|
|
||||
|
mounted() { |
||||
|
this.refreshPagedData() |
||||
|
} |
||||
|
|
||||
|
protected getPagedList(filter: any) { |
||||
|
return AuditingService.getSecurityLogs(filter) |
||||
|
} |
||||
|
|
||||
|
private handleShowSecurityLogDialog(securityLog: SecurityLog) { |
||||
|
this.securityLog = securityLog |
||||
|
this.showSecurityLog = true |
||||
|
} |
||||
|
|
||||
|
private handleDeleteSecurityLog(id: string) { |
||||
|
this.$confirm('是否要删除选定的安全日志记录?', |
||||
|
'删除安全日志', { |
||||
|
callback: (action) => { |
||||
|
if (action === 'confirm') { |
||||
|
AuditingService.deleteSecurityLog(id).then(() => { |
||||
|
this.$message.success('删除成功!') |
||||
|
this.refreshPagedData() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
|
||||
|
private onRowDoubleClicked(row: SecurityLog) { |
||||
|
this.handleShowSecurityLogDialog(row) |
||||
|
} |
||||
|
|
||||
|
private onSecurityLogDialogClosed() { |
||||
|
this.showSecurityLog = false |
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.data-filter-collapse-title { |
||||
|
font-size: 15px; |
||||
|
} |
||||
|
</style> |
||||
Loading…
Reference in new issue