Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
api
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
首航-临时账号
api
Commits
0393e09c
Commit
0393e09c
authored
Sep 24, 2019
by
java-李谡
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/develop' into develop
# Conflicts: # resources/redis.properties
parents
1b91afb7
abf67aaf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
UserController.java
src/com/ejweb/modules/user/api/UserController.java
+8
-4
No files found.
src/com/ejweb/modules/user/api/UserController.java
View file @
0393e09c
...
...
@@ -52,6 +52,10 @@ public class UserController {
private
int
ipWithinSeconds
;
@Value
(
"${redis.ipLimitTimes}"
)
private
int
ipLimitTimes
;
@Value
(
"${redis.userSealUpSeconds}"
)
private
int
userSealUpSeconds
;
@Value
(
"${redis.userOverdueSeconds}"
)
private
int
userOverdueSeconds
;
@Value
(
"${redis.usernameWithinSeconds}"
)
private
int
usernameWithinSeconds
;
@Value
(
"${redis.usernameLimitTimes}"
)
...
...
@@ -155,9 +159,9 @@ public class UserController {
}
String
blackUsername
=
redisUtils
.
get
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
);
boolean
sealup
=
false
;
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
usernameLimitTimes
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
blackUsernameTime
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
userSealUpSeconds
,
indexDb
);
sealup
=
true
;
}
else
if
(
blackUsername
!=
null
)
{
sealup
=
true
;
...
...
@@ -176,7 +180,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
nameWithin
Seconds
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
Overdue
Seconds
,
indexDb
);
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
...
...
@@ -225,7 +229,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
nameWithin
Seconds
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
Overdue
Seconds
,
indexDb
);
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
...
...
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