Commit f51a714b authored by yanzg's avatar yanzg

修复bug

parent ee48edef
package com.yanzuoguang.cloud.aop; package com.yanzuoguang.cloud.aop;
import com.yanzuoguang.cloud.CloudConfig; import com.yanzuoguang.cloud.CloudConfig;
import com.yanzuoguang.cloud.helper.CookiesHelper;
import com.yanzuoguang.util.helper.ArrayHelper; import com.yanzuoguang.util.helper.ArrayHelper;
import com.yanzuoguang.util.helper.StringHelper; import com.yanzuoguang.util.helper.StringHelper;
import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.ProceedingJoinPoint;
...@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping; ...@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
import java.lang.annotation.Annotation; import java.lang.annotation.Annotation;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.ArrayList; import java.util.ArrayList;
...@@ -94,24 +96,28 @@ public class AspectLogUrl { ...@@ -94,24 +96,28 @@ public class AspectLogUrl {
if (feignClient != null) { if (feignClient != null) {
sb.append(feignClient.value()); sb.append(feignClient.value());
sb.append(":"); sb.append(":");
}
List<RequestMapping> reqList = ArrayHelper.mergeList(classRequests, requests); List<RequestMapping> reqList = ArrayHelper.mergeList(classRequests, requests);
List<PostMapping> postList = ArrayHelper.mergeList(classPosts, posts); List<PostMapping> postList = ArrayHelper.mergeList(classPosts, posts);
List<GetMapping> getList = ArrayHelper.mergeList(classGets, gets); List<GetMapping> getList = ArrayHelper.mergeList(classGets, gets);
for (RequestMapping item : reqList) { for (RequestMapping item : reqList) {
if (item.value() != null && item.value().length > 0) { if (item.value() != null && item.value().length > 0) {
sb.append(item.value()[0]); sb.append(item.value()[0]);
}
} }
} for (PostMapping item : postList) {
for (PostMapping item : postList) { if (item.value() != null && item.value().length > 0) {
if (item.value() != null && item.value().length > 0) { sb.append(item.value()[0]);
sb.append(item.value()[0]); }
} }
} for (GetMapping item : getList) {
for (GetMapping item : getList) { if (item.value() != null && item.value().length > 0) {
if (item.value() != null && item.value().length > 0) { sb.append(item.value()[0]);
sb.append(item.value()[0]); }
} }
} else {
HttpServletRequest request = CookiesHelper.getRequest();
sb.append(request.getRequestURI());
} }
return sb.toString(); return sb.toString();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment