Skip to content

Commit 1988bbb

Browse files
authored
fix: request.getRequestURI() 避免多服务器并发锁不住
1 parent e0fcffa commit 1988bbb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/com/pig4cloud/plugin/idempotent/aspect/IdempotentAspect.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public void beforePointCut(JoinPoint joinPoint) {
7373

7474
// 若没有配置 幂等 标识编号,则使用 url + 参数列表作为区分
7575
if (!StringUtils.hasLength(idempotent.key())) {
76-
String url = request.getRequestURL().toString();
76+
String url = request.getRequestURI();
7777
String argString = Arrays.asList(joinPoint.getArgs()).toString();
7878
key = url + argString;
7979
}
@@ -83,7 +83,7 @@ public void beforePointCut(JoinPoint joinPoint) {
8383
}
8484
// 当配置了el表达式但是所选字段为空时,会抛出异常,兜底使用url做标识
8585
if (key == null) {
86-
key = request.getRequestURL().toString();
86+
key = request.getRequestURI();
8787
}
8888

8989
long expireTime = idempotent.expireTime();

0 commit comments

Comments
 (0)