From 76142b76de211fd890b3bbef486b146d883d665f Mon Sep 17 00:00:00 2001
From: TanYibin <5491541@qq.com>
Date: Wed, 5 Jul 2023 09:37:05 +0800
Subject: [PATCH] API日志api_name名称优化

---
 huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java |  9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java b/huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
index aae68cb..9643ad0 100644
--- a/huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
+++ b/huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
@@ -136,12 +136,17 @@ public class ApiLoggerAspect {
         try {
             String[] spList = url.toString().split("/");
             String apiName = spList[spList.length - 1];
-            apiLog.setApiName(apiName);
+            String originApiName = apiLog.getApiName();
+            if (StringUtils.isEmpty(originApiName)) {
+                apiLog.setApiName(apiName);
+            }
             apiLog.setRequestFrom(HUAHENG_SYSTEM_NAME);
             apiLog.setIp(JeecgSystemApplication.getLocalHostExactAddress().getHostAddress());
             Address address = SpringUtils.getBean(AddressServiceImpl.class).getAddressByUrl(url.toString());
             if (address != null) {
-                apiLog.setApiName(address.getRemark());
+                if (StringUtils.isEmpty(originApiName)) {
+                    apiLog.setApiName(address.getRemark());
+                }
                 apiLog.setResponseBy(address.getParam().toUpperCase());
             }
         } catch (Exception e) {
--
libgit2 0.22.2