Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
X
xyqb-user2
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
head_group
xyqb-user2
Commits
5b672d04
Commit
5b672d04
authored
Nov 23, 2017
by
Java—红包—徐 然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改增加日志
parent
d498c249
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
UserController.java
...ntgroup/xyqb/controller/internal/user/UserController.java
+4
-3
No files found.
src/main/java/cn/quantgroup/xyqb/controller/internal/user/UserController.java
View file @
5b672d04
...
@@ -540,9 +540,9 @@ public class UserController implements IBaseController {
...
@@ -540,9 +540,9 @@ public class UserController implements IBaseController {
* 向该ipv4添加错误计数器
* 向该ipv4添加错误计数器
*/
*/
private
void
countErrorByIpv4
()
{
private
void
countErrorByIpv4
()
{
if
(!
ValidationUtil
.
isAtDangerousTime
()){
//
if(!ValidationUtil.isAtDangerousTime()){
return
;
//
return;
}
//
}
String
ipv4
=
getIp
();
String
ipv4
=
getIp
();
if
(
StringUtils
.
isNotBlank
(
ipv4
)
&&
!
ValidationUtil
.
validateLocalIpv4
(
ipv4
))
{
if
(
StringUtils
.
isNotBlank
(
ipv4
)
&&
!
ValidationUtil
.
validateLocalIpv4
(
ipv4
))
{
String
ipv4Key
=
getIpKey
(
getIp
());
String
ipv4Key
=
getIpKey
(
getIp
());
...
@@ -551,6 +551,7 @@ public class UserController implements IBaseController {
...
@@ -551,6 +551,7 @@ public class UserController implements IBaseController {
stringRedisTemplate
.
opsForValue
().
set
(
ipv4Key
,
String
.
valueOf
(
0
),
Constants
.
IPV4_COUNT_MINUTES
,
TimeUnit
.
MINUTES
);
stringRedisTemplate
.
opsForValue
().
set
(
ipv4Key
,
String
.
valueOf
(
0
),
Constants
.
IPV4_COUNT_MINUTES
,
TimeUnit
.
MINUTES
);
}
}
Long
count
=
stringRedisTemplate
.
opsForValue
().
increment
(
ipv4Key
,
1L
);
Long
count
=
stringRedisTemplate
.
opsForValue
().
increment
(
ipv4Key
,
1L
);
LOGGER
.
info
(
"Count for Locked ip access:{}, count={}"
,
ipv4
,
count
);
if
(
count
>=
Constants
.
IPV4_LOCK_ON_COUNTS
){
if
(
count
>=
Constants
.
IPV4_LOCK_ON_COUNTS
){
String
lockIpv4Key
=
getLockIpv4Key
(
ipv4
);
String
lockIpv4Key
=
getLockIpv4Key
(
ipv4
);
stringRedisTemplate
.
opsForValue
().
set
(
lockIpv4Key
,
Boolean
.
TRUE
.
toString
(),
Constants
.
IPV4_LOCK_MINUTES
,
TimeUnit
.
MINUTES
);
stringRedisTemplate
.
opsForValue
().
set
(
lockIpv4Key
,
Boolean
.
TRUE
.
toString
(),
Constants
.
IPV4_LOCK_MINUTES
,
TimeUnit
.
MINUTES
);
...
...
Write
Preview
Markdown
is supported
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