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
c4499914
Commit
c4499914
authored
Sep 24, 2019
by
java-李谡
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加redis方法
parent
7815b27c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
15 deletions
+16
-15
redis.properties
resources/redis.properties
+3
-3
UserController.java
src/com/ejweb/modules/user/api/UserController.java
+13
-12
No files found.
resources/redis.properties
View file @
c4499914
...
...
@@ -8,5 +8,5 @@ redis.maxWaitMillis=10000
redis.testOnBorrow
=
true
redis.testOnReturn
=
true
redis.dbIndex
=
3
ipWithinSeconds
=
3600
ipLimitTimes
=
25
\ No newline at end of file
ipWithinSeconds
=
60
ipLimitTimes
=
10
\ No newline at end of file
src/com/ejweb/modules/user/api/UserController.java
View file @
c4499914
...
...
@@ -145,16 +145,17 @@ public class UserController {
LOG
.
debug
(
"[UserController login][STATUS_CODE_4102]总共用时:"
+
Util
.
getDurationTime
(
duration
));
return
responseBean
;
}
String
blackUsername
=
redisUtils
.
get
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
);
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
)
)
{
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
}
else
if
(
blackUsername
!=
null
&&
Integer
.
parseInt
(
blackUsername
)
==
1
){
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
300
,
indexDb
);
redisUtils
.
incrNotResetExpireTime
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
);
String
blackUsername
=
redisUtils
.
get
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
);
boolean
sealup
=
false
;
if
(
null
!=
redisUsername
&&
Integer
.
parseInt
(
redisUsername
)
>=
5
&&
StringUtils
.
isEmpty
(
blackUsername
))
{
redisUtils
.
set
(
"black_username:"
+
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
"black_username:"
+
loginBean
.
getLoginName
(),
60
,
indexDb
);
sealup
=
true
;
}
else
if
(
blackUsername
!=
null
)
{
sealup
=
true
;
}
if
(
redisUtils
.
get
(
"black_username:"
+
loginBean
.
getLoginName
(),
indexDb
)!=
null
)
{
if
(
sealup
)
{
responseBean
.
setStatus
(
ErrorCode
.
STATUS_CODE_4101
);
responseBean
.
setMessage
(
"该帐号已禁止登录"
);
checkIpLimit
(
userIp
);
...
...
@@ -167,7 +168,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
3
60
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
60
,
indexDb
);
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
...
...
@@ -216,7 +217,7 @@ public class UserController {
// 用户信息redis初始时间 增加value值
if
(
StringUtils
.
isEmpty
(
redisUsername
))
{
redisUtils
.
set
(
loginBean
.
getLoginName
(),
1
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
3
60
,
indexDb
);
redisUtils
.
expire
(
loginBean
.
getLoginName
(),
60
,
indexDb
);
}
else
{
redisUtils
.
incrNotResetExpireTime
(
loginBean
.
getLoginName
(),
indexDb
);
}
...
...
@@ -749,7 +750,7 @@ public class UserController {
// deviceInfoEntity.setDeviceToken(loginBean.getDeviceToken());
// deviceInfoEntity.setPlatform(loginBean.getPlatform());
// deviceInfoEntity.setVersion(loginBean.getVersionName());
UserLoginLogEntity
deviceInfoEntity
=
new
UserLoginLogEntity
();
deviceInfoEntity
.
setUserId
(
userEntity
.
getId
());
deviceInfoEntity
.
setLoginDate
(
new
Date
());
...
...
@@ -961,7 +962,7 @@ public class UserController {
if
(
message
==
null
)
{
String
seatMobilePhone
=
""
;
//修改允许席位手机号为空,如果为空,则修改席位手机号为用户手机号
if
(
StringUtils
.
isEmpty
(
loginBean
.
getSeatMobile
()))
{
if
(
StringUtils
.
isEmpty
(
loginBean
.
getSeatMobile
()))
{
UserEntity
userEntity
=
new
UserEntity
();
userEntity
.
setUsercode
(
loginBean
.
getUserId
());
User
user
=
userService
.
getUserByUserCode
(
userEntity
);
...
...
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