|
@@ -1,11 +1,11 @@
|
|
|
package com.xs.core.filter;
|
|
|
|
|
|
-import cn.hutool.core.date.DatePattern;
|
|
|
import cn.hutool.core.util.ReflectUtil;
|
|
|
import com.alibaba.fastjson2.JSON;
|
|
|
import com.alibaba.fastjson2.JSONObject;
|
|
|
import com.alibaba.fastjson2.JSONWriter;
|
|
|
import com.alibaba.fastjson2.filter.ContextValueFilter;
|
|
|
+import com.xs.core.common.annotation.EntryIgnore;
|
|
|
import com.xs.core.utils.SecurityUtil;
|
|
|
import jakarta.servlet.http.HttpServletRequest;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -23,6 +23,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
import org.springframework.web.servlet.mvc.method.annotation.ResponseBodyAdvice;
|
|
|
|
|
|
import java.lang.reflect.Field;
|
|
|
+import java.lang.reflect.Method;
|
|
|
import java.time.LocalDateTime;
|
|
|
|
|
|
/**
|
|
@@ -44,7 +45,12 @@ public class ResponseHandler implements ResponseBodyAdvice<Object> {
|
|
|
*/
|
|
|
@Override
|
|
|
public boolean supports(MethodParameter methodParameter, Class<? extends HttpMessageConverter<?>> aClass) {
|
|
|
- return true;
|
|
|
+ Method method = methodParameter.getMethod();
|
|
|
+ //如过方法上有注解,直接返回false,不走beforeBodyWrite方法
|
|
|
+ if (method != null && method.isAnnotationPresent(EntryIgnore.class)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return isEncryption;
|
|
|
}
|
|
|
|
|
|
/**
|