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
f13c2468
Commit
f13c2468
authored
Sep 24, 2019
by
zhangyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登陆修改
parent
c4499914
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
6 deletions
+14
-6
redis.properties
resources/redis.properties
+7
-3
UserController.java
src/com/ejweb/modules/user/api/UserController.java
+7
-3
No files found.
resources/redis.properties
View file @
f13c2468
...
@@ -8,5 +8,10 @@ redis.maxWaitMillis=10000
...
@@ -8,5 +8,10 @@ redis.maxWaitMillis=10000
redis.testOnBorrow
=
true
redis.testOnBorrow
=
true
redis.testOnReturn
=
true
redis.testOnReturn
=
true
redis.dbIndex
=
3
redis.dbIndex
=
3
ipWithinSeconds
=
60
ipWithinSeconds
=
3600
ipLimitTimes
=
10
ipLimitTimes
=
25
\ No newline at end of file
# \u67E5\u5C01\u65F6\u95F4
userSealUpSeconds
=
300
# \u8FC7\u671F\u65F6\u95F4
userOverdueSeconds
=
1800
src/com/ejweb/modules/user/api/UserController.java
View file @
f13c2468
...
@@ -49,6 +49,10 @@ public class UserController {
...
@@ -49,6 +49,10 @@ public class UserController {
private
MobileVerifyService
mobileVerifyService
;
private
MobileVerifyService
mobileVerifyService
;
@Value
(
"${redis.dbIndex}"
)
@Value
(
"${redis.dbIndex}"
)
private
int
indexDb
;
private
int
indexDb
;
@Value
(
"${redis.userSealUpSeconds}"
)
private
int
userSealUpSeconds
;
@Value
(
"${redis.userOverdueSeconds}"
)
private
int
userOverdueSeconds
;
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Autowired
@Autowired
...
@@ -149,7 +153,7 @@ public class UserController {
...
@@ -149,7 +153,7 @@ public class UserController {
boolean
sealup
=
false
;
boolean
sealup
=
false
;
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
60
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
userSealUpSeconds
,
indexDb
);
sealup
=
true
;
sealup
=
true
;
}
else
if
(
blackUsername
!=
null
)
{
}
else
if
(
blackUsername
!=
null
)
{
sealup
=
true
;
sealup
=
true
;
...
@@ -168,7 +172,7 @@ public class UserController {
...
@@ -168,7 +172,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
60
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
userOverdueSeconds
,
indexDb
);
}
else
{
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
}
...
@@ -217,7 +221,7 @@ public class UserController {
...
@@ -217,7 +221,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
60
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
userOverdueSeconds
,
indexDb
);
}
else
{
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
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