This commit is contained in:
2025-04-08 16:53:39 +08:00
parent fde99b1352
commit 7c123ce792

View File

@@ -29,6 +29,7 @@ public class OperateLogService : IOperateLog
var now = DateTime.Now; var now = DateTime.Now;
var userId = _currentUser.GetIntSubjectId(); var userId = _currentUser.GetIntSubjectId();
var userName = _currentUser.GetName(); var userName = _currentUser.GetName();
var tenantId = _currentUser.GetStringTenantId();
try try
{ {
@@ -40,7 +41,8 @@ public class OperateLogService : IOperateLog
CreateTime = now, CreateTime = now,
ModifiedTime = now, ModifiedTime = now,
CreatedBy = userId, CreatedBy = userId,
ModifiedBy = userId ModifiedBy = userId,
TenantId = tenantId
}); });
} }
catch (Exception e) catch (Exception e)
@@ -52,7 +54,10 @@ public class OperateLogService : IOperateLog
/// <inheritdoc /> /// <inheritdoc />
public async Task<Pagination<OperateLogResponse>> GetOperateLogPageAsync(OperateLogPageRequest request) public async Task<Pagination<OperateLogResponse>> GetOperateLogPageAsync(OperateLogPageRequest request)
{ {
var tenantId = _currentUser.GetStringTenantId();
return await _dbContext.Queryable<OperateLogEntity>() return await _dbContext.Queryable<OperateLogEntity>()
.Where(x => x.TenantId == tenantId)
.Select(x => new OperateLogResponse .Select(x => new OperateLogResponse
{ {
Content = x.Content, Content = x.Content,