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
dcb47dd5
Commit
dcb47dd5
authored
Nov 23, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
抓住异常保证登录可以正常
parent
91bb84b7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
25 deletions
+29
-25
DeviceInterceptorAspect.java
...antgroup/xyqb/aspect/captcha/DeviceInterceptorAspect.java
+29
-25
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/captcha/DeviceInterceptorAspect.java
View file @
dcb47dd5
...
...
@@ -175,42 +175,46 @@ public class DeviceInterceptorAspect {
* @param ip
*/
private
void
saveLoginInfo
(
String
phone
,
String
deviceCode
,
String
deviceId
,
String
ip
)
{
try
{
/**
* 默认code不需要
* 默认CODE 不存
*/
if
(
DEFAULT_CODE
.
equals
(
deviceId
))
{
return
;
}
/**
* 默认code不需要
* 默认CODE 不存
*/
if
(
DEFAULT_CODE
.
equals
(
deviceId
))
{
return
;
}
Device
device
=
Device
.
valueOfCode
(
deviceCode
);
Device
device
=
Device
.
valueOfCode
(
deviceCode
);
if
(
null
==
device
)
{
log
.
warn
(
"咋回事啊没找到code对应的设备code:{}"
,
deviceCode
);
}
Long
count
=
1L
;
LoginInfo
info
=
loginInfoRepository
.
getFirstByPhoneNoAndDevice
(
phone
,
device
);
if
(
null
==
device
)
{
log
.
warn
(
"咋回事啊没找到code对应的设备code:{}"
,
deviceCode
);
}
Long
count
=
1L
;
LoginInfo
info
=
loginInfoRepository
.
getFirstByPhoneNoAndDevice
(
phone
,
device
);
if
(
null
==
info
)
{
info
=
new
LoginInfo
(
);
}
else
{
count
=
info
.
getLoginCount
()
+
1L
;
}
if
(
null
==
info
)
{
info
=
new
LoginInfo
();
}
else
{
count
=
info
.
getLoginCount
()
+
1L
;
}
info
.
setPhoneNo
(
phone
);
info
.
setPhoneNo
(
phone
);
info
.
setDeviceId
(
deviceId
);
info
.
setDeviceId
(
deviceId
);
info
.
setLastLoginAt
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
//当前时间
info
.
setLastLoginAt
(
Timestamp
.
valueOf
(
LocalDateTime
.
now
()));
//当前时间
info
.
setDevice
(
device
);
info
.
setDevice
(
device
);
info
.
setLoginCount
(
count
);
info
.
setLoginCount
(
count
);
info
.
setLastIp
(
ip
);
info
.
setLastIp
(
ip
);
loginInfoRepository
.
save
(
info
);
}
catch
(
Exception
e
)
{
log
.
error
(
"保存登录信息异常phone:{}"
,
phone
,
e
);
}
loginInfoRepository
.
save
(
info
);
}
/**
...
...
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