diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs index c1be7f4f..3c1def75 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogGetListInputVo.cs @@ -9,15 +9,7 @@ namespace Yi.Framework.OperLog { public class OperationLogGetListInputVo : PagedAllResultRequestDto { - public string? Title { get; set; } - public OperEnum OperType { get; set; } - public string? RequestMethod { get; set; } + public OperEnum? OperType { get; set; } public string? OperUser { get; set; } - public string? OperIp { get; set; } - public string? OperLocation { get; set; } - public string? Method { get; set; } - public string? RequestParam { get; set; } - public string? RequestResult { get; set; } - public DateTime CreationTime { get; set; } } } diff --git a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs index d2843854..dc57a9aa 100644 --- a/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs +++ b/Yi.Framework.Net6/src/module/Yi.Framework.OperLog/OperationLogService.cs @@ -12,9 +12,23 @@ namespace Yi.Framework.OperLog public class OperationLogService : CrudAppService, IOperationLogService, IAutoApiService { - public override Task> GetListAsync(OperationLogGetListInputVo input) + public override async Task> GetListAsync(OperationLogGetListInputVo input) { - return base.GetListAsync(input); + var entity = await MapToEntityAsync(input); + + RefAsync total = 0; + + var entities = await _DbQueryable.WhereIF(!string.IsNullOrEmpty(input.OperUser), x => x.OperUser.Contains(input.OperUser!)) + .WhereIF(input.OperType is not null, x => x.OperType==input.OperType) + .WhereIF(input.StartTime is not null && input.EndTime is not null, x => x.CreationTime >= input.StartTime && x.CreationTime <= input.EndTime) + .ToPageListAsync(input.PageNum, input.PageSize, total); + return new PagedResultDto(total, await MapToGetListOutputDtosAsync(entities)); + } + + [NonAction] + public override Task UpdateAsync(long id, OperationLogGetListOutputDto input) + { + return base.UpdateAsync(id, input); } } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/RoleService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/RoleService.cs index bf516fd0..a9af44dc 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/RoleService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Identity/RoleService.cs @@ -99,6 +99,7 @@ namespace Yi.RBAC.Application.Identity } entity.State = state; + await _repository.UpdateAsync(entity); return await MapToGetOutputDtoAsync(entity); } } diff --git a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/LoginLogService.cs b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/LoginLogService.cs index 3ab6d27f..a0a34d8f 100644 --- a/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/LoginLogService.cs +++ b/Yi.Framework.Net6/src/project/rbac/Yi.RBAC.Application/Logs/LoginLogService.cs @@ -1,4 +1,5 @@ -using NET.AutoWebApi.Setting; +using Microsoft.AspNetCore.Mvc; +using NET.AutoWebApi.Setting; using SqlSugar; using System; using System.Collections.Generic; @@ -29,5 +30,10 @@ namespace Yi.RBAC.Application.Logs return new PagedResultDto(total, await MapToGetListOutputDtosAsync(entities)); } + [NonAction] + public override Task UpdateAsync(long id, LoginLogGetListOutputDto input) + { + return base.UpdateAsync(id, input); + } } } diff --git a/Yi.RuoYi.Vue3/src/api/monitor/operlog.js b/Yi.RuoYi.Vue3/src/api/monitor/operlog.js index 17c3470a..4a0e9bf9 100644 --- a/Yi.RuoYi.Vue3/src/api/monitor/operlog.js +++ b/Yi.RuoYi.Vue3/src/api/monitor/operlog.js @@ -3,7 +3,7 @@ import request from '@/utils/request' // 查询操作日志列表 export function list(query) { return request({ - url: '/operationLog/pageList', + url: '/operation-log', method: 'get', params: query }) diff --git a/Yi.RuoYi.Vue3/src/views/monitor/operlog/index.vue b/Yi.RuoYi.Vue3/src/views/monitor/operlog/index.vue index 4e2510c4..4e152056 100644 --- a/Yi.RuoYi.Vue3/src/views/monitor/operlog/index.vue +++ b/Yi.RuoYi.Vue3/src/views/monitor/operlog/index.vue @@ -155,8 +155,8 @@ -
正常
-
失败
+
正常
+
失败
@@ -212,7 +212,7 @@ const { queryParams, form } = toRefs(data); function getList() { loading.value = true; list(proxy.addDateRange(queryParams.value, dateRange.value)).then(response => { - operlogList.value = response.data.data; + operlogList.value = response.data.items; total.value = response.data.total; loading.value = false; });