Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cust-api
Project
Project
Details
Activity
Releases
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
李伟
cust-api
Commits
cc6c0e71
Commit
cc6c0e71
authored
Mar 05, 2025
by
liwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改了实名认证接口
parent
763e5d3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
47 additions
and
10 deletions
+47
-10
FaceVerifyServiceImpl.java
...libaba/faceVerify/service/impl/FaceVerifyServiceImpl.java
+45
-8
MemInfoServiceImpl.java
...oft/business/memInfo/service/impl/MemInfoServiceImpl.java
+2
-2
No files found.
src/main/java/org/rcisoft/alibaba/faceVerify/service/impl/FaceVerifyServiceImpl.java
View file @
cc6c0e71
...
...
@@ -112,15 +112,52 @@ public class FaceVerifyServiceImpl extends ServiceImpl<MemInfoRepository, MemInf
map
.
put
(
"requestId"
,
response
.
getBody
().
getRequestId
());
map
.
put
(
"certifyId"
,
response
.
getBody
().
getResultObject
().
getCertifyId
());
map
.
put
(
"certifyUrl"
,
response
.
getBody
().
getResultObject
().
getCertifyUrl
());
}
else
if
(
"401"
.
equals
(
response
.
getBody
().
getCode
()))
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"输入的姓名或者身份证号码有误"
);
}
else
if
(
"418"
.
equals
(
response
.
getBody
().
getCode
()))
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"当天刷脸认证次数过多,请明天再试。"
);
}
else
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"发起认证请求失败"
);
HttpServletRequest
request1
=
((
ServletRequestAttributes
)
(
RequestContextHolder
.
getRequestAttributes
())).
getRequest
();
String
ip
=
CyAddressUtils
.
IpUtils
.
getIpAddr
(
request1
);
Object
ipMin
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_MINUTES
+
ip
);
// 1 设置 ip 每分钟的失败次数
if
(
ipMin
!=
null
)
{
int
count
=
(
int
)
ipMin
;
cyRedisServiceImpl
.
setValueNotTime
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_MINUTES
+
ip
,
count
+
1
,
0
);
}
else
cyRedisServiceImpl
.
set
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_MINUTES
+
ip
,
1
,
60L
);
Object
ipDay
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_DAY
+
ip
);
// 1 设置 ip 每天的失败次数
if
(
ipDay
!=
null
)
{
int
count
=
(
int
)
ipDay
;
cyRedisServiceImpl
.
setValueNotTime
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_DAY
+
ip
,
count
+
1
,
0
);
}
else
{
long
time
=
TimeUtil
.
getTimeSecond
(
new
Date
(),
TimeUtil
.
getTodayEndTime
());
cyRedisServiceImpl
.
set
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_DAY
+
ip
,
1
,
time
);
}
Object
idCardMin
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_MINUTES
+
idCard
);
// 1 设置 ip 每分钟的失败次数
if
(
idCardMin
!=
null
)
{
int
count
=
(
int
)
idCardMin
;
cyRedisServiceImpl
.
setValueNotTime
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_MINUTES
+
idCard
,
count
+
1
,
0
);
}
else
cyRedisServiceImpl
.
set
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_MINUTES
+
idCard
,
1
,
60L
);
Object
idCardDay
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_DAY
+
idCard
);
// 1 设置 ip 每天的失败次数
if
(
idCardDay
!=
null
)
{
int
count
=
(
int
)
idCardDay
;
cyRedisServiceImpl
.
setValueNotTime
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_DAY
+
idCard
,
count
+
1
,
0
);
}
else
{
long
time
=
TimeUtil
.
getTimeSecond
(
new
Date
(),
TimeUtil
.
getTodayEndTime
());
cyRedisServiceImpl
.
set
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_DAY
+
idCard
,
1
,
time
);
}
if
(
"401"
.
equals
(
response
.
getBody
().
getCode
()))
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"输入的姓名或者身份证号码有误"
);
}
else
if
(
"418"
.
equals
(
response
.
getBody
().
getCode
()))
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"当天刷脸认证次数过多,请明天再试。"
);
}
else
{
log
.
error
(
"发起认证请求失败:"
+
response
.
getBody
().
getMessage
());
throw
new
CyServiceException
(
"发起认证请求失败"
);
}
}
return
map
;
}
else
...
...
src/main/java/org/rcisoft/business/memInfo/service/impl/MemInfoServiceImpl.java
View file @
cc6c0e71
...
...
@@ -565,14 +565,14 @@ public class MemInfoServiceImpl extends ServiceImpl<MemInfoRepository,MemInfo>
if
(
captcha
!=
null
)
{
int
count
=
(
int
)
captcha
;
if
(
count
>=
faceVerifyAliComp
.
getIpMinCount
())
throw
new
CyServiceException
(
"实名认证发起频繁,请稍后重试"
);
throw
new
CyServiceException
(
"
当前IP
实名认证发起频繁,请稍后重试"
);
}
//2. 同一IP,每天失败次数
captcha
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IP_DAY
+
ip
);
if
(
captcha
!=
null
)
{
int
count
=
(
int
)
captcha
;
if
(
count
>=
faceVerifyAliComp
.
getIpDayCount
())
throw
new
CyServiceException
(
"实名认证次数已达上限,请明日再试!"
);
throw
new
CyServiceException
(
"
当前IP
实名认证次数已达上限,请明日再试!"
);
}
//3. 同一身份证,每分钟失败次数
captcha
=
cyRedisServiceImpl
.
get
(
FaceVerifyRedisBean
.
FACEVERIFY_IDCARD_MINUTES
+
memInfo
.
getMemIdcard
());
...
...
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