From 9318f182b0a226d1a55d5989e37f037d1b87c910 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期六, 17 八月 2024 10:10:51 +0800 Subject: [PATCH] reset 回滚 修改spring源码上下文持有者(存在数据未清理内存泄漏问题) --- ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOperLogServiceImpl.java | 25 ++++--------------------- 1 files changed, 4 insertions(+), 21 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOperLogServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOperLogServiceImpl.java index 45f2638..b78b9dc 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOperLogServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOperLogServiceImpl.java @@ -3,23 +3,18 @@ import cn.hutool.core.util.ArrayUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import jakarta.servlet.http.HttpServletRequest; -import lombok.RequiredArgsConstructor; -import org.dromara.common.core.domain.model.LoginUser; import org.dromara.common.core.utils.MapstructUtils; -import org.dromara.common.core.utils.ServletUtils; -import org.dromara.common.core.utils.StringUtils; -import org.dromara.common.core.utils.ip.AddressUtils; -import org.dromara.common.log.enums.BusinessStatus; -import org.dromara.common.log.event.OperLogEvent; import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.TableDataInfo; -import org.dromara.common.satoken.utils.LoginHelper; +import org.dromara.common.core.utils.StringUtils; +import org.dromara.common.core.utils.ip.AddressUtils; +import org.dromara.common.log.event.OperLogEvent; import org.dromara.system.domain.SysOperLog; import org.dromara.system.domain.bo.SysOperLogBo; import org.dromara.system.domain.vo.SysOperLogVo; import org.dromara.system.mapper.SysOperLogMapper; import org.dromara.system.service.ISysOperLogService; +import lombok.RequiredArgsConstructor; import org.springframework.context.event.EventListener; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; @@ -49,18 +44,6 @@ @EventListener public void recordOper(OperLogEvent operLogEvent) { SysOperLogBo operLog = MapstructUtils.convert(operLogEvent, SysOperLogBo.class); - operLog.setTenantId(LoginHelper.getTenantId()); - operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); - // 璇锋眰鐨勫湴鍧� - String ip = ServletUtils.getClientIP(); - operLog.setOperIp(ip); - HttpServletRequest request = ServletUtils.getRequest(); - operLog.setOperUrl(StringUtils.substring(request.getRequestURI(), 0, 255)); - LoginUser loginUser = LoginHelper.getLoginUser(); - operLog.setOperName(loginUser.getUsername()); - operLog.setDeptName(loginUser.getDeptName()); - // 璁剧疆璇锋眰鏂瑰紡 - operLog.setRequestMethod(request.getMethod()); // 杩滅▼鏌ヨ鎿嶄綔鍦扮偣 operLog.setOperLocation(AddressUtils.getRealAddressByIP(operLog.getOperIp())); insertOperlog(operLog); -- Gitblit v1.9.3