Browse Source

update 优化 加密拦截器plugin方法按规定返回代理对象

疯狂的狮子Li 5 months ago
parent
commit
f6d9bec16c

+ 2 - 5
ruoyi-common/ruoyi-common-encrypt/src/main/java/org/dromara/common/encrypt/interceptor/MybatisEncryptInterceptor.java

@@ -6,10 +6,7 @@ import cn.hutool.core.util.ObjectUtil;
 import lombok.AllArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.ibatis.executor.parameter.ParameterHandler;
-import org.apache.ibatis.plugin.Interceptor;
-import org.apache.ibatis.plugin.Intercepts;
-import org.apache.ibatis.plugin.Invocation;
-import org.apache.ibatis.plugin.Signature;
+import org.apache.ibatis.plugin.*;
 import org.dromara.common.core.utils.StringUtils;
 import org.dromara.common.encrypt.annotation.EncryptField;
 import org.dromara.common.encrypt.core.EncryptContext;
@@ -54,7 +51,7 @@ public class MybatisEncryptInterceptor implements Interceptor {
                 this.encryptHandler(parameterObject);
             }
         }
-        return target;
+        return Plugin.wrap(target, this);
     }
 
     /**