Commit 76142b76de211fd890b3bbef486b146d883d665f
1 parent
4891ce55
API日志api_name名称优化
Signed-off-by: TanYibin <5491541@qq.com>
Showing
1 changed file
with
7 additions
and
2 deletions
huaheng-wms-core/src/main/java/org/jeecg/utils/aspect/ApiLoggerAspect.java
... | ... | @@ -136,12 +136,17 @@ public class ApiLoggerAspect { |
136 | 136 | try { |
137 | 137 | String[] spList = url.toString().split("/"); |
138 | 138 | String apiName = spList[spList.length - 1]; |
139 | - apiLog.setApiName(apiName); | |
139 | + String originApiName = apiLog.getApiName(); | |
140 | + if (StringUtils.isEmpty(originApiName)) { | |
141 | + apiLog.setApiName(apiName); | |
142 | + } | |
140 | 143 | apiLog.setRequestFrom(HUAHENG_SYSTEM_NAME); |
141 | 144 | apiLog.setIp(JeecgSystemApplication.getLocalHostExactAddress().getHostAddress()); |
142 | 145 | Address address = SpringUtils.getBean(AddressServiceImpl.class).getAddressByUrl(url.toString()); |
143 | 146 | if (address != null) { |
144 | - apiLog.setApiName(address.getRemark()); | |
147 | + if (StringUtils.isEmpty(originApiName)) { | |
148 | + apiLog.setApiName(address.getRemark()); | |
149 | + } | |
145 | 150 | apiLog.setResponseBy(address.getParam().toUpperCase()); |
146 | 151 | } |
147 | 152 | } catch (Exception e) { |
... | ... |