jinpengyong
2021-05-13 943a2364c76db4c4e570e0d0219a81b6caa9bffc
screen-api/src/main/java/com/moral/api/utils/OperationLogUtils.java
@@ -25,13 +25,15 @@
        this.userLogService = userLogService;
    }
    public static void insertLog(HttpServletRequest request, String content) {
    public static 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"));
        userLog.setOrganizationId((Integer) currentUserInfo.get("organizationId"));
        Map<String, Object> orgInfo = (Map<String, Object>) currentUserInfo.get("organization");
        userLog.setOrganizationId((Integer) orgInfo.get("id"));
        userLog.setContent(content);
        userLogService.save(userLog);
    }