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
e699da13
Commit
e699da13
authored
Nov 25, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加enable
parent
1f46082c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
LoginInterceptorAspect.java
...uantgroup/xyqb/aspect/captcha/LoginInterceptorAspect.java
+2
-2
WhiteListRepository.java
...va/cn/quantgroup/xyqb/repository/WhiteListRepository.java
+1
-1
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/captcha/LoginInterceptorAspect.java
View file @
e699da13
...
@@ -141,7 +141,7 @@ public class LoginInterceptorAspect {
...
@@ -141,7 +141,7 @@ public class LoginInterceptorAspect {
Long
deviceNum
=
loginInfoRepository
.
countByDeviceId
(
deviceId
);
Long
deviceNum
=
loginInfoRepository
.
countByDeviceId
(
deviceId
);
if
(
DEVICE_REFUSE_COUNT
.
compareTo
(
deviceNum
)
<
0
)
{
if
(
DEVICE_REFUSE_COUNT
.
compareTo
(
deviceNum
)
<
=
0
)
{
if
(
isWhite
(
deviceId
,
KeyType
.
DEVICEID
))
{
if
(
isWhite
(
deviceId
,
KeyType
.
DEVICEID
))
{
log
.
warn
(
"此设备登录命中拒绝策略,但是在白名单deviceId:{}"
,
deviceId
,
deviceNum
);
log
.
warn
(
"此设备登录命中拒绝策略,但是在白名单deviceId:{}"
,
deviceId
,
deviceNum
);
return
LoginRefuseResult
.
builder
()
return
LoginRefuseResult
.
builder
()
...
@@ -267,7 +267,7 @@ public class LoginInterceptorAspect {
...
@@ -267,7 +267,7 @@ public class LoginInterceptorAspect {
* @return
* @return
*/
*/
private
boolean
isWhite
(
String
key
,
KeyType
type
)
{
private
boolean
isWhite
(
String
key
,
KeyType
type
)
{
return
whiteListRepository
.
countByKeyEqualsAndTypeEquals
(
key
,
type
)
>
0
;
return
whiteListRepository
.
countByKeyEqualsAndTypeEquals
AndEnableIsTrue
(
key
,
type
)
>
0
;
}
}
/**
/**
* 【登录设备反欺诈策略】
* 【登录设备反欺诈策略】
...
...
src/main/java/cn/quantgroup/xyqb/repository/WhiteListRepository.java
View file @
e699da13
...
@@ -7,5 +7,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -7,5 +7,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
public
interface
WhiteListRepository
extends
JpaRepository
<
WhiteList
,
Long
>
{
public
interface
WhiteListRepository
extends
JpaRepository
<
WhiteList
,
Long
>
{
Long
countByKeyEqualsAndTypeEquals
(
String
key
,
KeyType
type
);
Long
countByKeyEqualsAndTypeEquals
AndEnableIsTrue
(
String
key
,
KeyType
type
);
}
}
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