Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
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
youjj
cloud-platform
Commits
9826759a
Commit
9826759a
authored
Nov 04, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改实名认证
parent
218e3849
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
28 deletions
+12
-28
XCFQPictureParsingImpl.java
...l/service/PictureParsing/impl/XCFQPictureParsingImpl.java
+5
-14
XCFQAuthentication.java
...vice/authenticationInterface/impl/XCFQAuthentication.java
+7
-14
No files found.
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/PictureParsing/impl/XCFQPictureParsingImpl.java
View file @
9826759a
...
@@ -27,16 +27,15 @@ import java.util.Map;
...
@@ -27,16 +27,15 @@ import java.util.Map;
@Slf4j
@Slf4j
public
class
XCFQPictureParsingImpl
implements
UserPictureParsing
{
public
class
XCFQPictureParsingImpl
implements
UserPictureParsing
{
private
String
appcode
=
"acea1c8811f748b3a65815f11db357c4"
;
//
private String appcode = "acea1c8811f748b3a65815f11db357c4";
private
String
appcode2
=
"ee7710ce92054cae9f6c040f6864e6a7"
;
private
String
appcode2
=
"ee7710ce92054cae9f6c040f6864e6a7"
;
/**
/**
* 认证相关的数据
* 认证相关的数据
*/
*/
private
String
host
=
"https://ocridcard.market.alicloudapi.com"
;
private
String
host
=
"https://ocridcards.market.alicloudapi.com"
;
private
String
path
=
"/idimages"
;
private
String
path
=
"/idcard"
;
private
String
methd
=
"POST"
;
private
String
methd
=
"POST"
;
...
@@ -81,7 +80,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
...
@@ -81,7 +80,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
}
}
private
Map
<
String
,
String
>
judgeAccordingToAnalyticalData
(
String
imageUrl
,
String
type
)
{
private
Map
<
String
,
String
>
judgeAccordingToAnalyticalData
(
String
imageUrl
,
String
type
)
{
String
json
=
imageParse
(
imageUrl
,
type
);
String
json
=
imageParse
(
imageUrl
);
log
.
info
(
"json:"
+
json
);
log
.
info
(
"json:"
+
json
);
if
(
StringUtils
.
isBlank
(
json
))
{
if
(
StringUtils
.
isBlank
(
json
))
{
return
null
;
return
null
;
...
@@ -103,14 +102,12 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
...
@@ -103,14 +102,12 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
//身份证照片解析
//身份证照片解析
private
String
imageParse
(
String
imageUrl
,
String
type
)
{
private
String
imageParse
(
String
imageUrl
)
{
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode2
);
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode2
);
Map
<
String
,
String
>
querys
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
querys
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
bodys
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
bodys
=
new
HashMap
<
String
,
String
>();
bodys
.
put
(
"image"
,
imageUrl
);
bodys
.
put
(
"image"
,
imageUrl
);
//默认正面front,背面请传back
bodys
.
put
(
"idCardSide"
,
type
);
try
{
try
{
return
callExternalRequest
(
headers
,
querys
,
bodys
,
1
);
return
callExternalRequest
(
headers
,
querys
,
bodys
,
1
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
...
@@ -140,13 +137,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
...
@@ -140,13 +137,7 @@ public class XCFQPictureParsingImpl implements UserPictureParsing {
}
}
if
(
403
==
statusCode
){
if
(
403
==
statusCode
){
if
(
type
==
2
){
log
.
error
(
"验证次数已用完"
);
log
.
error
(
"验证次数已用完"
);
return
null
;
}
Map
<
String
,
String
>
headers2
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode
);
return
callExternalRequest
(
headers2
,
querys
,
bodys
,
2
);
}
}
return
null
;
return
null
;
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/service/authenticationInterface/impl/XCFQAuthentication.java
View file @
9826759a
...
@@ -28,9 +28,8 @@ import java.util.Map;
...
@@ -28,9 +28,8 @@ import java.util.Map;
@Primary
@Primary
public
class
XCFQAuthentication
implements
UserAuthentication
{
public
class
XCFQAuthentication
implements
UserAuthentication
{
private
String
appcode
=
"acea1c8811f748b3a65815f11db357c4"
;
// private String appcode="acea1c8811f748b3a65815f11db357c4";
private
String
appcode2
=
"ee7710ce92054cae9f6c040f6864e6a7"
;
private
String
appcode2
=
"ee7710ce92054cae9f6c040f6864e6a7"
;
/**
/**
* 认证相关的数据
* 认证相关的数据
...
@@ -59,7 +58,7 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -59,7 +58,7 @@ public class XCFQAuthentication implements UserAuthentication {
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
Map
<
String
,
String
>
headers
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode2
);
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode2
);
try
{
try
{
callExternalRequest
(
message
,
headers
,
1
);
callExternalRequest
(
message
,
headers
,
1
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
...
@@ -67,7 +66,7 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -67,7 +66,7 @@ public class XCFQAuthentication implements UserAuthentication {
}
}
private
boolean
callExternalRequest
(
UserMessage
message
,
Map
<
String
,
String
>
headers
,
int
type
)
throws
Exception
{
private
boolean
callExternalRequest
(
UserMessage
message
,
Map
<
String
,
String
>
headers
,
int
type
)
throws
Exception
{
//map携带身份证和姓名进行认证
//map携带身份证和姓名进行认证
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
Map
<
String
,
String
>
querys
=
new
HashMap
<>();
querys
.
put
(
idCardName
,
message
.
getIdNumber
());
querys
.
put
(
idCardName
,
message
.
getIdNumber
());
...
@@ -79,7 +78,7 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -79,7 +78,7 @@ public class XCFQAuthentication implements UserAuthentication {
/**
/**
* 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误
* 状态码: 200 正常;400 URL无效;401 appCode错误; 403 次数用完; 500 API网管错误
*/
*/
log
.
info
(
"外部接口响应状态码:"
+
statusCode
);
log
.
info
(
"外部接口响应状态码:"
+
statusCode
);
//获取response的body
//获取response的body
if
(
statusCode
==
200
)
{
if
(
statusCode
==
200
)
{
...
@@ -95,14 +94,8 @@ public class XCFQAuthentication implements UserAuthentication {
...
@@ -95,14 +94,8 @@ public class XCFQAuthentication implements UserAuthentication {
}
}
}
}
if
(
403
==
statusCode
){
if
(
403
==
statusCode
)
{
if
(
type
==
2
){
log
.
error
(
"验证次数已用完"
);
log
.
error
(
"验证次数已用完"
);
return
false
;
}
Map
<
String
,
String
>
headers2
=
new
HashMap
<
String
,
String
>();
headers
.
put
(
"Authorization"
,
"APPCODE "
+
appcode
);
return
callExternalRequest
(
message
,
headers2
,
2
);
}
}
return
false
;
return
false
;
...
...
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