29 changed files with 15790 additions and 15137 deletions
@ -0,0 +1,9 @@ |
|||||
|
namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; |
||||
|
|
||||
|
public interface IIdentitySecurityLogAppService : IApplicationService |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 分页获取登录日志
|
||||
|
/// </summary>
|
||||
|
Task<PagedResultDto<PagingIdentitySecurityLogOutput>> GetListAsync(PagingIdentitySecurityLogInput input); |
||||
|
} |
||||
@ -0,0 +1,51 @@ |
|||||
|
namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; |
||||
|
|
||||
|
public class PagingIdentitySecurityLogInput: PagingBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 排序
|
||||
|
/// </summary>
|
||||
|
public string Sorting { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 开始时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? StartTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 结束时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? EndTime { get; set; } |
||||
|
|
||||
|
public string Identity { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求地址
|
||||
|
/// </summary>
|
||||
|
public string Action { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 用户Id
|
||||
|
/// </summary>
|
||||
|
public Guid? UserId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 用户名
|
||||
|
/// </summary>
|
||||
|
public string UserName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 应用程序名称
|
||||
|
/// </summary>
|
||||
|
public string ApplicationName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// RequestId
|
||||
|
/// </summary>
|
||||
|
public string CorrelationId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// ClientId
|
||||
|
/// </summary>
|
||||
|
public string ClientId { get; set; } |
||||
|
} |
||||
@ -0,0 +1,30 @@ |
|||||
|
namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; |
||||
|
|
||||
|
public class PagingIdentitySecurityLogOutput |
||||
|
{ |
||||
|
public Guid Id { get; set; } |
||||
|
|
||||
|
public Guid? TenantId { get; set; } |
||||
|
|
||||
|
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,46 @@ |
|||||
|
namespace Lion.AbpPro.BasicManagement.IdentitySecurityLogs; |
||||
|
|
||||
|
public class IdentitySecurityLogAppService : BasicManagementAppService, IIdentitySecurityLogAppService |
||||
|
{ |
||||
|
private readonly IIdentitySecurityLogRepository _identitySecurityLogRepository; |
||||
|
|
||||
|
public IdentitySecurityLogAppService(IIdentitySecurityLogRepository identitySecurityLogRepository) |
||||
|
{ |
||||
|
_identitySecurityLogRepository = identitySecurityLogRepository; |
||||
|
} |
||||
|
|
||||
|
[Authorize(Policy = BasicManagementPermissions.SystemManagement.IdentitySecurityLog)] |
||||
|
public virtual async Task<PagedResultDto<PagingIdentitySecurityLogOutput>> GetListAsync(PagingIdentitySecurityLogInput input) |
||||
|
{ |
||||
|
var totalCount = await _identitySecurityLogRepository.GetCountAsync( |
||||
|
input.StartTime, |
||||
|
input.EndTime, |
||||
|
input.ApplicationName, |
||||
|
input.Identity, |
||||
|
input.Action, |
||||
|
input.UserId, |
||||
|
input.UserName, |
||||
|
input.ClientId, |
||||
|
input.CorrelationId); |
||||
|
if (totalCount == 0) |
||||
|
{ |
||||
|
return new PagedResultDto<PagingIdentitySecurityLogOutput>(); |
||||
|
} |
||||
|
|
||||
|
var list = await _identitySecurityLogRepository.GetListAsync( |
||||
|
input.Sorting, |
||||
|
input.PageSize, |
||||
|
input.SkipCount, |
||||
|
input.StartTime, |
||||
|
input.EndTime, |
||||
|
input.ApplicationName, |
||||
|
input.Identity, |
||||
|
input.Action, |
||||
|
input.UserId, |
||||
|
input.UserName, |
||||
|
input.ClientId, |
||||
|
input.CorrelationId); |
||||
|
|
||||
|
return new PagedResultDto<PagingIdentitySecurityLogOutput>(totalCount, ObjectMapper.Map<List<IdentitySecurityLog>, List<PagingIdentitySecurityLogOutput>>(list)); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,19 @@ |
|||||
|
namespace Lion.AbpPro.BasicManagement.Systems; |
||||
|
|
||||
|
[Route("IdentitySecurityLogs")] |
||||
|
public class IdentitySecurityLogController : BasicManagementController, IIdentitySecurityLogAppService |
||||
|
{ |
||||
|
private readonly IIdentitySecurityLogAppService _identitySecurityLogAppService; |
||||
|
|
||||
|
public IdentitySecurityLogController(IIdentitySecurityLogAppService identitySecurityLogAppService) |
||||
|
{ |
||||
|
_identitySecurityLogAppService = identitySecurityLogAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("page")] |
||||
|
[SwaggerOperation(summary: "分页获取登录日志信息", Tags = new[] { "IdentitySecurityLogs" })] |
||||
|
public Task<PagedResultDto<PagingIdentitySecurityLogOutput>> GetListAsync(PagingIdentitySecurityLogInput input) |
||||
|
{ |
||||
|
return _identitySecurityLogAppService.GetListAsync(input); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,80 @@ |
|||||
|
import {FormSchema} from '/src/components/Table'; |
||||
|
import {BasicColumn} from '/src/components/Table'; |
||||
|
import {useI18n} from '/src/hooks/web/useI18n'; |
||||
|
import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; |
||||
|
const {t} = useI18n(); |
||||
|
import { |
||||
|
IdentitySecurityLogsServiceProxy, |
||||
|
PageIdentitySecurityLogInput, |
||||
|
} from '/src/services/ServiceProxies'; |
||||
|
|
||||
|
// 分页表格登录日志 BasicColumn
|
||||
|
export const tableColumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ApplicationName'), |
||||
|
dataIndex: 'applicationName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Identity'), |
||||
|
dataIndex: 'identity', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Action'), |
||||
|
dataIndex: 'action', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
dataIndex: 'userName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CorrelationId'), |
||||
|
dataIndex: 'correlationId', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ClientIpAddress'), |
||||
|
dataIndex: 'clientIpAddress', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CreationTime'), |
||||
|
dataIndex: 'creationTime', |
||||
|
customRender: ({ text }) => { |
||||
|
return formatToDateTime(text); |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
// 分页查询登录日志 FormSchema
|
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'time', |
||||
|
component: 'RangePicker', |
||||
|
label: t('routes.admin.audit_executeTime'), |
||||
|
colProps: { |
||||
|
span: 4, |
||||
|
}, |
||||
|
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
label: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
component: 'Input', |
||||
|
colProps: { span: 3 }, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'correlationId', |
||||
|
label: 'CorrelationId', |
||||
|
labelWidth: 95, |
||||
|
component: 'Input', |
||||
|
colProps: { span: 4 }, |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询登录日志 |
||||
|
*/ |
||||
|
export async function pageAsync(params: PageIdentitySecurityLogInput, |
||||
|
) { |
||||
|
const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); |
||||
|
return identitySecurityLogServiceProxy.page(params); |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<BasicTable @register="registerTable" size="small"> |
||||
|
</BasicTable> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { defineComponent } from 'vue'; |
||||
|
import { useI18n } from '/src/hooks/web/useI18n'; |
||||
|
import { BasicTable, TableAction, useTable } from '/src/components/Table'; |
||||
|
import { tableColumns, searchFormSchema, pageAsync} from './Index'; |
||||
|
export default defineComponent({ |
||||
|
name: 'IdentitySecurityLog', |
||||
|
components: { |
||||
|
BasicTable, |
||||
|
TableAction, |
||||
|
}, |
||||
|
setup() { |
||||
|
const { t } = useI18n(); |
||||
|
// table配置 |
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
columns: tableColumns, |
||||
|
formConfig: { |
||||
|
labelWidth: 70, |
||||
|
schemas: searchFormSchema, |
||||
|
}, |
||||
|
api: pageAsync, |
||||
|
showTableSetting: true, |
||||
|
useSearchForm: true, |
||||
|
bordered: true, |
||||
|
canResize: true, |
||||
|
showIndexColumn: true, |
||||
|
immediate: true, |
||||
|
scroll: { x: true }, |
||||
|
}); |
||||
|
|
||||
|
return { |
||||
|
registerTable, |
||||
|
reload, |
||||
|
t, |
||||
|
}; |
||||
|
}, |
||||
|
}); |
||||
|
</script> |
||||
@ -0,0 +1,80 @@ |
|||||
|
import {FormSchema} from '/src/components/Table'; |
||||
|
import {BasicColumn} from '/src/components/Table'; |
||||
|
import {useI18n} from '/src/hooks/web/useI18n'; |
||||
|
import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; |
||||
|
const {t} = useI18n(); |
||||
|
import { |
||||
|
IdentitySecurityLogsServiceProxy, |
||||
|
PageIdentitySecurityLogInput, |
||||
|
} from '/src/services/ServiceProxies'; |
||||
|
|
||||
|
// 分页表格登录日志 BasicColumn
|
||||
|
export const tableColumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ApplicationName'), |
||||
|
dataIndex: 'applicationName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Identity'), |
||||
|
dataIndex: 'identity', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Action'), |
||||
|
dataIndex: 'action', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
dataIndex: 'userName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CorrelationId'), |
||||
|
dataIndex: 'correlationId', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ClientIpAddress'), |
||||
|
dataIndex: 'clientIpAddress', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CreationTime'), |
||||
|
dataIndex: 'creationTime', |
||||
|
customRender: ({ text }) => { |
||||
|
return formatToDateTime(text); |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
// 分页查询登录日志 FormSchema
|
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'time', |
||||
|
component: 'RangePicker', |
||||
|
label: t('routes.admin.audit_executeTime'), |
||||
|
colProps: { |
||||
|
span: 4, |
||||
|
}, |
||||
|
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
label: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
component: 'Input', |
||||
|
colProps: { span: 3 }, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'correlationId', |
||||
|
label: 'CorrelationId', |
||||
|
labelWidth: 95, |
||||
|
component: 'Input', |
||||
|
colProps: { span: 4 }, |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询登录日志 |
||||
|
*/ |
||||
|
export async function pageAsync(params: PageIdentitySecurityLogInput, |
||||
|
) { |
||||
|
const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); |
||||
|
return identitySecurityLogServiceProxy.page(params); |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<BasicTable @register="registerTable" size="small"> |
||||
|
</BasicTable> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { defineComponent } from 'vue'; |
||||
|
import { useI18n } from '/src/hooks/web/useI18n'; |
||||
|
import { BasicTable, TableAction, useTable } from '/src/components/Table'; |
||||
|
import { tableColumns, searchFormSchema, pageAsync} from './Index'; |
||||
|
export default defineComponent({ |
||||
|
name: 'IdentitySecurityLog', |
||||
|
components: { |
||||
|
BasicTable, |
||||
|
TableAction, |
||||
|
}, |
||||
|
setup() { |
||||
|
const { t } = useI18n(); |
||||
|
// table配置 |
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
columns: tableColumns, |
||||
|
formConfig: { |
||||
|
labelWidth: 70, |
||||
|
schemas: searchFormSchema, |
||||
|
}, |
||||
|
api: pageAsync, |
||||
|
showTableSetting: true, |
||||
|
useSearchForm: true, |
||||
|
bordered: true, |
||||
|
canResize: true, |
||||
|
showIndexColumn: true, |
||||
|
immediate: true, |
||||
|
scroll: { x: true }, |
||||
|
}); |
||||
|
|
||||
|
return { |
||||
|
registerTable, |
||||
|
reload, |
||||
|
t, |
||||
|
}; |
||||
|
}, |
||||
|
}); |
||||
|
</script> |
||||
File diff suppressed because it is too large
@ -0,0 +1,80 @@ |
|||||
|
import {FormSchema} from '/src/components/Table'; |
||||
|
import {BasicColumn} from '/src/components/Table'; |
||||
|
import {useI18n} from '/src/hooks/web/useI18n'; |
||||
|
import { formatToDateTime, dateUtil } from '/src/utils/dateUtil'; |
||||
|
const {t} = useI18n(); |
||||
|
import { |
||||
|
IdentitySecurityLogsServiceProxy, |
||||
|
PageIdentitySecurityLogInput, |
||||
|
} from '/src/services/ServiceProxies'; |
||||
|
|
||||
|
// 分页表格登录日志 BasicColumn
|
||||
|
export const tableColumns: BasicColumn[] = [ |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ApplicationName'), |
||||
|
dataIndex: 'applicationName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Identity'), |
||||
|
dataIndex: 'identity', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_Action'), |
||||
|
dataIndex: 'action', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
dataIndex: 'userName', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CorrelationId'), |
||||
|
dataIndex: 'correlationId', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_ClientIpAddress'), |
||||
|
dataIndex: 'clientIpAddress', |
||||
|
}, |
||||
|
{ |
||||
|
title: t('routes.admin.identitySecurityLog_CreationTime'), |
||||
|
dataIndex: 'creationTime', |
||||
|
customRender: ({ text }) => { |
||||
|
return formatToDateTime(text); |
||||
|
}, |
||||
|
}, |
||||
|
]; |
||||
|
|
||||
|
// 分页查询登录日志 FormSchema
|
||||
|
export const searchFormSchema: FormSchema[] = [ |
||||
|
{ |
||||
|
field: 'time', |
||||
|
component: 'RangePicker', |
||||
|
label: t('routes.admin.audit_executeTime'), |
||||
|
colProps: { |
||||
|
span: 4, |
||||
|
}, |
||||
|
defaultValue: [dateUtil().subtract(7, 'days'), dateUtil().add(1, 'days')], |
||||
|
}, |
||||
|
{ |
||||
|
field: 'userName', |
||||
|
label: t('routes.admin.identitySecurityLog_UserName'), |
||||
|
component: 'Input', |
||||
|
colProps: { span: 3 }, |
||||
|
}, |
||||
|
{ |
||||
|
field: 'correlationId', |
||||
|
label: 'CorrelationId', |
||||
|
labelWidth: 95, |
||||
|
component: 'Input', |
||||
|
colProps: { span: 4 }, |
||||
|
} |
||||
|
]; |
||||
|
|
||||
|
|
||||
|
/** |
||||
|
* 分页查询登录日志 |
||||
|
*/ |
||||
|
export async function pageAsync(params: PageIdentitySecurityLogInput, |
||||
|
) { |
||||
|
const identitySecurityLogServiceProxy = new IdentitySecurityLogsServiceProxy(); |
||||
|
return identitySecurityLogServiceProxy.page(params); |
||||
|
} |
||||
@ -0,0 +1,45 @@ |
|||||
|
<template> |
||||
|
<div> |
||||
|
<BasicTable @register="registerTable" size="small"> |
||||
|
</BasicTable> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script lang="ts"> |
||||
|
import { defineComponent } from 'vue'; |
||||
|
import { useI18n } from '/src/hooks/web/useI18n'; |
||||
|
import { BasicTable, TableAction, useTable } from '/src/components/Table'; |
||||
|
import { tableColumns, searchFormSchema, pageAsync} from './Index'; |
||||
|
export default defineComponent({ |
||||
|
name: 'IdentitySecurityLog', |
||||
|
components: { |
||||
|
BasicTable, |
||||
|
TableAction, |
||||
|
}, |
||||
|
setup() { |
||||
|
const { t } = useI18n(); |
||||
|
// table配置 |
||||
|
const [registerTable, { reload }] = useTable({ |
||||
|
columns: tableColumns, |
||||
|
formConfig: { |
||||
|
labelWidth: 70, |
||||
|
schemas: searchFormSchema, |
||||
|
}, |
||||
|
api: pageAsync, |
||||
|
showTableSetting: true, |
||||
|
useSearchForm: true, |
||||
|
bordered: true, |
||||
|
canResize: true, |
||||
|
showIndexColumn: true, |
||||
|
immediate: true, |
||||
|
scroll: { x: true }, |
||||
|
}); |
||||
|
|
||||
|
return { |
||||
|
registerTable, |
||||
|
reload, |
||||
|
t, |
||||
|
}; |
||||
|
}, |
||||
|
}); |
||||
|
</script> |
||||
Loading…
Reference in new issue