matianxiang 3 weken geleden
bovenliggende
commit
104fa4ce9c
1 gewijzigde bestanden met toevoegingen van 17 en 17 verwijderingen
  1. 17 17
      eitc-common/src/main/java/com/eitc/common/filter/CustomResponseBodyAdviceAdapter.java

+ 17 - 17
eitc-common/src/main/java/com/eitc/common/filter/CustomResponseBodyAdviceAdapter.java

@@ -32,23 +32,23 @@ public class CustomResponseBodyAdviceAdapter implements ResponseBodyAdvice<Objec
32 32
     @Override
33 33
     public Object beforeBodyWrite(Object body, MethodParameter returnType, MediaType selectedContentType,
34 34
                                   Class selectedConverterType, ServerHttpRequest request, ServerHttpResponse response) {
35
-//        if (body instanceof AjaxResult) {
36
-//            AjaxResult ajaxResult = (AjaxResult) body;
37
-//            try {
38
-//                return CryptoUtil.encrypt(JSON.toJSONString(ajaxResult));
39
-//            } catch (Exception e) {
40
-//                log.error("AjaxResult加密失败:" + body, e);
41
-//                return ajaxResult;
42
-//            }
43
-//        } else if (body instanceof TableDataInfo) {
44
-//            TableDataInfo tableDataInfo = (TableDataInfo) body;
45
-//            try {
46
-//                return CryptoUtil.encrypt(JSON.toJSONString(tableDataInfo));
47
-//            } catch (Exception e) {
48
-//                log.error("TableDataInfo加密失败:" + body, e);
49
-//                return tableDataInfo;
50
-//            }
51
-//        }
35
+        if (body instanceof AjaxResult) {
36
+            AjaxResult ajaxResult = (AjaxResult) body;
37
+            try {
38
+                return CryptoUtil.encrypt(JSON.toJSONString(ajaxResult));
39
+            } catch (Exception e) {
40
+                log.error("AjaxResult加密失败:" + body, e);
41
+                return ajaxResult;
42
+            }
43
+        } else if (body instanceof TableDataInfo) {
44
+            TableDataInfo tableDataInfo = (TableDataInfo) body;
45
+            try {
46
+                return CryptoUtil.encrypt(JSON.toJSONString(tableDataInfo));
47
+            } catch (Exception e) {
48
+                log.error("TableDataInfo加密失败:" + body, e);
49
+                return tableDataInfo;
50
+            }
51
+        }
52 52
         return body;
53 53
     }
54 54
 }