记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
1fec8ce6
Commit
1fec8ce6
authored
Mar 18, 2022
by
zhengfuxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
验证身份证。
parent
a1eb5602
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
SmileRedisConst.java
...om/liquidnet/service/goblin/constant/SmileRedisConst.java
+1
-0
SmileUserController.java
...com/liquidnet/service/controller/SmileUserController.java
+12
-3
No files found.
liquidnet-bus-api/liquidnet-service-smile-api/src/main/java/com/liquidnet/service/goblin/constant/SmileRedisConst.java
View file @
1fec8ce6
...
@@ -4,6 +4,7 @@ public class SmileRedisConst {
...
@@ -4,6 +4,7 @@ public class SmileRedisConst {
public
static
final
String
PREFIX
=
"smile:"
;
public
static
final
String
PREFIX
=
"smile:"
;
public
static
final
String
SMILE_USER
=
PREFIX
.
concat
(
"user"
);
//用户key
public
static
final
String
SMILE_USER
=
PREFIX
.
concat
(
"user"
);
//用户key
public
static
final
String
SMILE_USER_VALIDATE
=
PREFIX
.
concat
(
"user:validate"
);
//用户key
public
static
final
String
SMILE_SCHOOL
=
PREFIX
.
concat
(
"school"
);
//校园key
public
static
final
String
SMILE_SCHOOL
=
PREFIX
.
concat
(
"school"
);
//校园key
...
...
liquidnet-bus-service/liquidnet-service-smile/liquidnet-service-smile-impl/src/main/java/com/liquidnet/service/controller/SmileUserController.java
View file @
1fec8ce6
...
@@ -98,7 +98,7 @@ public class SmileUserController {
...
@@ -98,7 +98,7 @@ public class SmileUserController {
public
ResponseDto
saveOrUpdateUserTwoStep
(
@RequestBody
SmileUserVO
smileUserVO
)
{
public
ResponseDto
saveOrUpdateUserTwoStep
(
@RequestBody
SmileUserVO
smileUserVO
)
{
if
(
StringUtil
.
isNotBlank
(
smileUserVO
.
getIdCard
())&&
StringUtil
.
isNotBlank
(
smileUserVO
.
getName
())){
if
(
StringUtil
.
isNotBlank
(
smileUserVO
.
getIdCard
())&&
StringUtil
.
isNotBlank
(
smileUserVO
.
getName
())){
String
userId
=
CurrentUtil
.
getCurrentUid
();
String
userId
=
CurrentUtil
.
getCurrentUid
();
if
(
validate
(
smileUserVO
.
getName
(),
smileUserVO
.
getIdCard
())){
if
(
validate
(
smileUserVO
.
getName
(),
smileUserVO
.
getIdCard
()
,
userId
)){
smileUserVO
.
setUid
(
userId
);
smileUserVO
.
setUid
(
userId
);
SmileUserVO
smileUserVORedis
=
(
SmileUserVO
)
redisUtil
.
get
(
SmileRedisConst
.
SMILE_USER
.
concat
(
userId
));
SmileUserVO
smileUserVORedis
=
(
SmileUserVO
)
redisUtil
.
get
(
SmileRedisConst
.
SMILE_USER
.
concat
(
userId
));
if
(
null
==
smileUserVORedis
){
if
(
null
==
smileUserVORedis
){
...
@@ -114,12 +114,21 @@ public class SmileUserController {
...
@@ -114,12 +114,21 @@ public class SmileUserController {
}
else
{
}
else
{
return
ResponseDto
.
failure
(
"验证身份证失败!"
);
return
ResponseDto
.
failure
(
"验证身份证失败!"
);
}
}
}
}
return
ResponseDto
.
success
();
return
ResponseDto
.
success
();
}
}
public
boolean
validate
(
String
realName
,
String
cardNo
){
public
boolean
validate
(
String
realName
,
String
cardNo
,
String
userid
){
Object
o
=
redisUtil
.
get
(
SmileRedisConst
.
SMILE_USER_VALIDATE
.
concat
(
userid
));
/* if(null==o){
}else{
List<String> list= (List<String>) redisUtil.get(SmileRedisConst.SMILE_USER_VALIDATE.concat(userid));
//验证是否以前验证过
for(){
}
}*/
String
respStr
=
IdentityUtils
.
aliThird
(
realName
,
cardNo
),
respErrorCode
=
null
;
String
respStr
=
IdentityUtils
.
aliThird
(
realName
,
cardNo
),
respErrorCode
=
null
;
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
JsonNode
respJNode
=
JsonUtils
.
fromJson
(
respStr
,
JsonNode
.
class
);
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respErrorCode
=
String
.
valueOf
(
respJNode
.
get
(
"error_code"
))))
{
if
(
null
==
respJNode
||
!
"0"
.
equals
(
respErrorCode
=
String
.
valueOf
(
respJNode
.
get
(
"error_code"
))))
{
...
...
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