From 920fc4bc49b9a8d5fd65533d09fb895424e27d21 Mon Sep 17 00:00:00 2001
From: 13693261870 <252740454@qq.com>
Date: 星期二, 11 七月 2023 09:21:00 +0800
Subject: [PATCH] 1

---
 src/main/java/com/moon/server/aspect/LogAspect.java        |   11 ++++++++++-
 src/main/java/com/moon/server/interceptor/ProxyFilter.java |   19 +++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/moon/server/aspect/LogAspect.java b/src/main/java/com/moon/server/aspect/LogAspect.java
index 6eff335..8a6027b 100644
--- a/src/main/java/com/moon/server/aspect/LogAspect.java
+++ b/src/main/java/com/moon/server/aspect/LogAspect.java
@@ -3,6 +3,7 @@
 import com.moon.server.annotation.SysLog;
 import com.moon.server.entity.sys.OperateEntity;
 import com.moon.server.entity.sys.UserEntity;
+import com.moon.server.helper.AsyncHelper;
 import com.moon.server.helper.WebHelper;
 import com.moon.server.service.sys.OperateService;
 import com.moon.server.service.sys.TokenService;
@@ -19,6 +20,7 @@
 
 import javax.servlet.http.HttpServletRequest;
 import java.lang.reflect.Method;
+import java.util.TimerTask;
 
 /**
  * 鏃ュ織鍒囬潰绫�
@@ -115,7 +117,14 @@
                 oe.setUserid(ue.getId());
             }
 
-            operateService.insertOperate(oe);
+            // operateService.insertOperate(oe)
+            AsyncHelper helper = new AsyncHelper();
+            helper.execute(new TimerTask() {
+                @Override
+                public void run() {
+                    operateService.insertOperate(oe);
+                }
+            });
         } catch (Exception ex) {
             log.error(ex.getMessage(), ex);
         }
diff --git a/src/main/java/com/moon/server/interceptor/ProxyFilter.java b/src/main/java/com/moon/server/interceptor/ProxyFilter.java
index ff353bb..7f1fd45 100644
--- a/src/main/java/com/moon/server/interceptor/ProxyFilter.java
+++ b/src/main/java/com/moon/server/interceptor/ProxyFilter.java
@@ -8,6 +8,7 @@
 import com.moon.server.entity.sys.TokenEntity;
 import com.moon.server.entity.sys.UserEntity;
 import com.moon.server.helper.AsyncHelper;
+import com.moon.server.helper.HttpHelper;
 import com.moon.server.helper.StringHelper;
 import com.moon.server.helper.WebHelper;
 import com.moon.server.service.all.PermsService;
@@ -71,6 +72,8 @@
             }
 
             insertLog(req, ue, resId);
+            String url = getSourceUrl(req, resId);
+            proxy(req, res, url);
         } catch (Exception ex) {
             log.error(ex.getMessage(), ex);
         }
@@ -248,4 +251,20 @@
                 return -1;
         }
     }
+
+    /**
+     * 鑾峰彇鍘熷Url
+     */
+    private String getSourceUrl(HttpServletRequest req, int resId) {
+
+        return "";
+    }
+
+    /**
+     * 浠g悊鏈嶅姟
+     */
+    private void proxy(HttpServletRequest request, HttpServletResponse response, String url) throws Exception {
+        HttpHelper httpHelper = new HttpHelper();
+        httpHelper.service(request, response, url, null);
+    }
 }

--
Gitblit v1.9.3