From dd37247e65374dd4ef7e8e8b9212d8f29023e301 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期一, 27 十二月 2021 09:50:42 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into satoken --- ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java | 10 ++-------- 1 files changed, 2 insertions(+), 8 deletions(-) diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 78a4b62..e7aa909 100644 --- a/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -2,12 +2,11 @@ import com.ruoyi.common.annotation.Log; import com.ruoyi.common.core.domain.dto.OperLogDTO; -import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.service.OperLogService; import com.ruoyi.common.enums.BusinessStatus; import com.ruoyi.common.enums.HttpMethod; import com.ruoyi.common.utils.JsonUtils; -import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.common.utils.LoginUtils; import com.ruoyi.common.utils.ServletUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.spring.SpringUtils; @@ -60,9 +59,6 @@ protected void handleLog(final JoinPoint joinPoint, Log controllerLog, final Exception e, Object jsonResult) { try { - // 鑾峰彇褰撳墠鐨勭敤鎴� - SysUser sysUser = SecurityUtils.getUser(); - // *========鏁版嵁搴撴棩蹇�=========*// OperLogDTO operLog = new OperLogDTO(); operLog.setStatus(BusinessStatus.SUCCESS.ordinal()); @@ -70,9 +66,7 @@ String ip = ServletUtils.getClientIP(); operLog.setOperIp(ip); operLog.setOperUrl(ServletUtils.getRequest().getRequestURI()); - if (sysUser != null) { - operLog.setOperName(sysUser.getUserName()); - } + operLog.setOperName(LoginUtils.getUsername()); if (e != null) { operLog.setStatus(BusinessStatus.FAIL.ordinal()); -- Gitblit v1.9.3