Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
f3a8b462
Commit
f3a8b462
authored
Sep 17, 2021
by
疯狂的狮子Li
Committed by
Gitee
Sep 17, 2021
Browse files
修复 全局限流key会多出一个"-" 将其移动到IP后面 去除多余的空格
parent
12ab8b03
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/RateLimiterAspect.java
View file @
f3a8b462
...
...
@@ -105,12 +105,12 @@ public class RateLimiterAspect
StringBuffer
stringBuffer
=
new
StringBuffer
(
rateLimiter
.
key
());
if
(
rateLimiter
.
limitType
()
==
LimitType
.
IP
)
{
stringBuffer
.
append
(
IpUtils
.
getIpAddr
(
ServletUtils
.
getRequest
()));
stringBuffer
.
append
(
IpUtils
.
getIpAddr
(
ServletUtils
.
getRequest
()))
.
append
(
"-"
)
;
}
MethodSignature
signature
=
(
MethodSignature
)
point
.
getSignature
();
Method
method
=
signature
.
getMethod
();
Class
<?>
targetClass
=
method
.
getDeclaringClass
();
stringBuffer
.
append
(
"-"
).
append
(
targetClass
.
getName
()).
append
(
"-
"
).
append
(
method
.
getName
());
stringBuffer
.
append
(
targetClass
.
getName
()).
append
(
"-"
).
append
(
method
.
getName
());
return
stringBuffer
.
toString
();
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment