From 424ad35dcd1fafb51a0ba77523b11e6871f2858c Mon Sep 17 00:00:00 2001
From: KKSU <15274802129@163.com>
Date: Thu, 06 Jun 2024 11:36:25 +0800
Subject: [PATCH] 购买节点

---
 src/main/java/cc/mrbird/febs/common/advise/MyRequestBodyAdvise.java |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/main/java/cc/mrbird/febs/common/advise/MyRequestBodyAdvise.java b/src/main/java/cc/mrbird/febs/common/advise/MyRequestBodyAdvise.java
index 7840f75..e061761 100644
--- a/src/main/java/cc/mrbird/febs/common/advise/MyRequestBodyAdvise.java
+++ b/src/main/java/cc/mrbird/febs/common/advise/MyRequestBodyAdvise.java
@@ -1,6 +1,7 @@
 package cc.mrbird.febs.common.advise;
 
 import cc.mrbird.febs.common.contants.AppContants;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.core.MethodParameter;
 import org.springframework.http.HttpInputMessage;
 import org.springframework.http.converter.HttpMessageConverter;
@@ -18,6 +19,9 @@
 @ControllerAdvice
 public class MyRequestBodyAdvise implements RequestBodyAdvice {
 
+    @Value("${system.debug}")
+    private boolean isDebug;
+
     @Override
     public boolean supports(MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) {
         return true;
@@ -26,7 +30,7 @@
     @Override
     public HttpInputMessage beforeBodyRead(HttpInputMessage inputMessage, MethodParameter methodParameter, Type type, Class<? extends HttpMessageConverter<?>> aClass) throws IOException {
 
-        if(!AppContants.ENCRYPT_METHOD.contains(methodParameter.getMethod().getName())) {
+        if(!AppContants.ENCRYPT_METHOD.contains(methodParameter.getMethod().getName()) || isDebug) {
             return inputMessage;
         }
 

--
Gitblit v1.9.1