From 9adcd1a977ee35dfc2e8041ef332295127939b09 Mon Sep 17 00:00:00 2001 From: xiangerlin <251481237@qq.com> Date: Mon, 11 Aug 2025 11:08:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frame/jdbcUtil/service/SqlLogInterceptor.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java b/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java index be78399c..336ed0f0 100644 --- a/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java +++ b/base-common/src/main/java/com/hzya/frame/jdbcUtil/service/SqlLogInterceptor.java @@ -1,5 +1,6 @@ package com.hzya.frame.jdbcUtil.service; +import cn.hutool.core.util.StrUtil; import org.apache.ibatis.executor.Executor; import org.apache.ibatis.mapping.BoundSql; import org.apache.ibatis.mapping.MappedStatement; @@ -55,6 +56,17 @@ public class SqlLogInterceptor implements Interceptor { Configuration configuration = mappedStatement.getConfiguration(); String sql = boundSql.getSql().replaceAll("[\\s]+", " "); List paramList = getParamList(configuration, boundSql); + + // 处理参数列表中的Base64字符串 + List processedParamList = new ArrayList<>(); + for (String param : paramList) { + if (param != null && param.length() > 2000 && isBase64(param)) { + processedParamList.add("base64"); + } else { + processedParamList.add(param); + } + } + if(sql.split("\\?").length > 1 && paramList.size() > 0){ StringBuffer stringBuffer = new StringBuffer(); String[] sqls = sql.split("\\?");