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
c0be2026
Commit
c0be2026
authored
Nov 26, 2020
by
董建华
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
拒绝策略调整
parent
54f1c197
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
LoginInterceptorAspect.java
...uantgroup/xyqb/aspect/captcha/LoginInterceptorAspect.java
+10
-4
No files found.
src/main/java/cn/quantgroup/xyqb/aspect/captcha/LoginInterceptorAspect.java
View file @
c0be2026
...
@@ -36,8 +36,9 @@ import java.util.Set;
...
@@ -36,8 +36,9 @@ import java.util.Set;
@Aspect
@Aspect
@Component
@Component
@Slf4j
@Slf4j
@Order
(
10
)
//
比较靠后执行
@Order
(
10
)
//
同心圆最外层
public
class
LoginInterceptorAspect
{
public
class
LoginInterceptorAspect
{
@Resource
@Resource
private
LoginInfoRepository
loginInfoRepository
;
private
LoginInfoRepository
loginInfoRepository
;
...
@@ -49,11 +50,16 @@ public class LoginInterceptorAspect {
...
@@ -49,11 +50,16 @@ public class LoginInterceptorAspect {
* 设备拒绝阈值
* 设备拒绝阈值
*/
*/
private
static
final
Long
DEVICE_REFUSE_COUNT
=
3L
;
private
static
final
Long
DEVICE_REFUSE_COUNT
=
3L
;
/**
* 风控拒绝策略1设备维度 2 账号维度
*/
private
static
final
int
[]
RISK_STRATEGY
=
{
1
,
2
};
/**
/**
* 警示语
* 警示语
*/
*/
private
final
String
ALERT_WORDS
=
"检测到您的设备上账号登录异常,已被强制退出并暂时冻结您的账号。联系客服400-002-0061"
;
private
final
String
ALERT_WORDS
=
"检测到您的设备上账号登录异常,已被强制退出并暂时冻结您的账号。联系客服400-002-0061"
;
/**
/**
* 拒绝策略e
* 拒绝策略e
*/
*/
...
@@ -61,7 +67,7 @@ public class LoginInterceptorAspect {
...
@@ -61,7 +67,7 @@ public class LoginInterceptorAspect {
static
{
static
{
DEVICE_REFUSE_STRATEGY
.
put
(
Device
.
ANDROID
,
3L
);
DEVICE_REFUSE_STRATEGY
.
put
(
Device
.
ANDROID
,
3L
);
DEVICE_REFUSE_STRATEGY
.
put
(
Device
.
IOS
,
7
L
);
DEVICE_REFUSE_STRATEGY
.
put
(
Device
.
IOS
,
3
L
);
}
}
...
@@ -151,7 +157,7 @@ public class LoginInterceptorAspect {
...
@@ -151,7 +157,7 @@ public class LoginInterceptorAspect {
log
.
warn
(
"此设备登录命中拒绝策略deviceId:{}超过{}个拒绝登录"
,
deviceId
,
deviceNum
);
log
.
warn
(
"此设备登录命中拒绝策略deviceId:{}超过{}个拒绝登录"
,
deviceId
,
deviceNum
);
return
LoginRefuseResult
.
builder
()
return
LoginRefuseResult
.
builder
()
.
isPass
(
Boolean
.
FALSE
)
.
isPass
(
Boolean
.
FALSE
)
.
rule
(
1
)
.
rule
(
RISK_STRATEGY
[
0
]
)
.
threshold
(
DEVICE_REFUSE_COUNT
.
intValue
())
.
threshold
(
DEVICE_REFUSE_COUNT
.
intValue
())
.
value
(
deviceNum
.
intValue
())
.
value
(
deviceNum
.
intValue
())
.
build
();
.
build
();
...
@@ -180,7 +186,7 @@ public class LoginInterceptorAspect {
...
@@ -180,7 +186,7 @@ public class LoginInterceptorAspect {
log
.
warn
(
"此账户登录命中拒绝策略并且没有白名单phone:{},device"
,
phone
);
log
.
warn
(
"此账户登录命中拒绝策略并且没有白名单phone:{},device"
,
phone
);
return
LoginRefuseResult
.
builder
()
return
LoginRefuseResult
.
builder
()
.
isPass
(
Boolean
.
FALSE
)
.
isPass
(
Boolean
.
FALSE
)
.
rule
(
2
)
.
rule
(
RISK_STRATEGY
[
1
]
)
.
threshold
(
threshold
.
intValue
())
.
threshold
(
threshold
.
intValue
())
.
value
(
Long
.
valueOf
(
sum
).
intValue
())
.
value
(
Long
.
valueOf
(
sum
).
intValue
())
.
build
();
.
build
();
...
...
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