提交者
Gitee
!321 修复 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格
Merge pull request !321 from 疯狂的狮子Li/N/A
正在显示
1 个修改的文件
包含
2 行增加
和
2 行删除
| @@ -105,12 +105,12 @@ public class RateLimiterAspect | @@ -105,12 +105,12 @@ public class RateLimiterAspect | ||
| 105 | StringBuffer stringBuffer = new StringBuffer(rateLimiter.key()); | 105 | StringBuffer stringBuffer = new StringBuffer(rateLimiter.key()); |
| 106 | if (rateLimiter.limitType() == LimitType.IP) | 106 | if (rateLimiter.limitType() == LimitType.IP) |
| 107 | { | 107 | { |
| 108 | - stringBuffer.append(IpUtils.getIpAddr(ServletUtils.getRequest())); | 108 | + stringBuffer.append(IpUtils.getIpAddr(ServletUtils.getRequest())).append("-"); |
| 109 | } | 109 | } |
| 110 | MethodSignature signature = (MethodSignature) point.getSignature(); | 110 | MethodSignature signature = (MethodSignature) point.getSignature(); |
| 111 | Method method = signature.getMethod(); | 111 | Method method = signature.getMethod(); |
| 112 | Class<?> targetClass = method.getDeclaringClass(); | 112 | Class<?> targetClass = method.getDeclaringClass(); |
| 113 | - stringBuffer.append("-").append(targetClass.getName()).append("- ").append(method.getName()); | 113 | + stringBuffer.append(targetClass.getName()).append("-").append(method.getName()); |
| 114 | return stringBuffer.toString(); | 114 | return stringBuffer.toString(); |
| 115 | } | 115 | } |
| 116 | } | 116 | } |
-
请 注册 或 登录 后发表评论