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
849888c1
Commit
849888c1
authored
Sep 24, 2019
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更改bug
parent
239c0628
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
8 deletions
+4
-8
UserController.java
src/com/ejweb/modules/user/api/UserController.java
+4
-8
No files found.
src/com/ejweb/modules/user/api/UserController.java
View file @
849888c1
...
...
@@ -52,10 +52,6 @@ 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}"
)
...
...
@@ -161,10 +157,10 @@ public class UserController {
}
String
blackUsername
=
redisUtils
.
get
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
);
boolean
sealup
=
false
;
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
usernameLimitTimes
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
System
.
out
.
println
(
"加入黑名单"
);
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
userSealUpSeconds
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
blackUsernameTime
,
indexDb
);
sealup
=
true
;
}
else
if
(
blackUsername
!=
null
)
{
sealup
=
true
;
...
...
@@ -184,7 +180,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
Overdue
Seconds
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
nameWithin
Seconds
,
indexDb
);
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
...
...
@@ -235,7 +231,7 @@ public class UserController {
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
System
.
out
.
println
(
"账户错误初始化"
);
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
Overdue
Seconds
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
user
nameWithin
Seconds
,
indexDb
);
}
else
{
System
.
out
.
println
(
"账户错误加1"
);
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