From ab676b53eaeb3779d0beaf9f525a63eb3d5e60d0 Mon Sep 17 00:00:00 2001 From: kaiyu <404897439@qq.com> Date: Thu, 15 Jul 2021 13:03:15 +0800 Subject: [PATCH] screen-api 修改manageBug --- screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java | 11 +++++------ 1 files changed, 5 insertions(+), 6 deletions(-) diff --git a/screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java b/screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java index 88afde3..9f9468c 100644 --- a/screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java +++ b/screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java @@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; +import org.springframework.transaction.annotation.Transactional; import com.moral.api.entity.UserLog; import com.moral.api.service.UserLogService; @@ -18,17 +19,15 @@ @Component public class OperationLogUtils { - private static UserLogService userLogService; - @Autowired - public void setUserLogService(UserLogService userLogService) { - this.userLogService = userLogService; - } + private UserLogService userLogService; - public static void insertLog(HttpServletRequest request, String content) { + @Transactional + public void insertLog(HttpServletRequest request, String content, String type) { String token = request.getHeader("token"); Map<String, Object> currentUserInfo = (Map<String, Object>) TokenUtils.getUserInfoByToken(token); UserLog userLog = new UserLog(); + userLog.setType(type); userLog.setIp(WebUtils.getIpAddr(request)); userLog.setOperateId((Integer) currentUserInfo.get("userId")); Map<String, Object> orgInfo = (Map<String, Object>) currentUserInfo.get("organization"); -- Gitblit v1.8.0