Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
1bd516aa
Commit
1bd516aa
authored
Jul 09, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
86d2286c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
151 additions
and
16 deletions
+151
-16
bpo-web/app/base/service/impl/utilesignbaoSve.js
+84
-16
bpo-web/app/base/service/impl/utillbwSve.js
+66
-0
bpo-web/app/config/settings.js
+1
-0
No files found.
bpo-web/app/base/service/impl/utilesignbaoSve.js
View file @
1bd516aa
...
...
@@ -22,36 +22,101 @@ class UtilESignBaoService {
this
.
lbwConfig
=
settings
.
apiconfig
.
lbwConfig
();
this
.
restClient
=
System
.
getObject
(
"util.restClient"
);
this
.
merchantId
=
"131032002020009"
;
//商户ID
this
.
idauthlogDao
=
System
.
getObject
(
"db.idauthlogDao"
)
this
.
idauthlogDao
=
System
.
getObject
(
"db.idauthlogDao"
)
}
//-------------------------------------------------------------------------e签宝银行四要素、三要素验证---开始----------------
async
personTwo
(
params
,
opName
)
{
// 个人二要素验证
console
.
log
(
opName
,
"兰铂旺二要素验证"
);
var
result
=
{
code
:
1
,
message
:
"success"
,
data
:
{}
};
var
reqUrl
=
this
.
eSignBaoBankVerifyUrl
+
"/infoauth/psn/identity"
;
var
tResult
=
await
this
.
returnResult
(
params
,
reqUrl
,
opName
,
"personTwo"
,
result
);
if
(
tResult
.
errCode
!=
0
)
{
result
.
code
=
-
110
;
if
(
tResult
.
message
&&
tResult
.
message
.
indexOf
(
":"
)
>
0
)
{
var
tmpListStr
=
tResult
.
message
.
split
(
':'
);
result
.
message
=
tmpListStr
[
1
]
?
tmpListStr
[
1
]
:
tmpListStr
[
0
];
}
else
{
result
.
message
=
"个人二要素验证失败"
;
}
return
result
;
var
merchantTraceNo
=
await
this
.
getRandomCode
(
32
);
var
merchantRequestTime
=
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
);
var
bizType
=
"010301"
;
var
encrypt
=
{
"chName"
:
params
.
name
,
//姓名
"idType"
:
"01"
,
"idNum"
:
params
.
idno
,
//身份证号,
"mchInfo"
:
"汉唐信通(北京)科技有限公司"
,
"riskInfo"
:
params
.
cardno
,
};
var
encryptStr
=
JSON
.
stringify
(
encrypt
);
var
str
=
crypto
.
privateEncrypt
(
this
.
lbwConfig
.
pik
,
Buffer
.
from
(
encryptStr
)).
toString
(
'base64'
);
var
paramMap
=
{};
paramMap
.
merchantId
=
this
.
merchantId
;
paramMap
.
bizType
=
bizType
;
paramMap
.
merchantTraceNo
=
merchantTraceNo
;
paramMap
.
merchantRequestTime
=
merchantRequestTime
;
paramMap
.
encrypt
=
str
;
var
signStr
=
await
this
.
sortParam
(
paramMap
);
var
sign
=
md5
(
signStr
);
var
list
=
{
"merchantId"
:
this
.
merchantId
,
"bizType"
:
bizType
,
"merchantTraceNo"
:
merchantTraceNo
,
"merchantRequestTime"
:
merchantRequestTime
,
"encrypt"
:
str
,
"sign"
:
sign
}
if
(
tResult
.
errCode
==
0
&&
tResult
.
data
&&
!
tResult
.
data
.
pass
)
{
result
.
code
=
-
120
;
result
.
message
=
"姓名或身份证错误"
;
console
.
log
(
"请求参数="
,
list
);
let
rs
=
await
axios
({
url
:
this
.
lbwConfig
.
validate_idcard
,
method
:
'post'
,
data
:
list
,
transformRequest
:
[
function
(
data
)
{
data
=
Qs
.
stringify
(
data
);
return
data
;
}],
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
},
});
console
.
log
(
"返回状态==="
,
rs
.
status
);
console
.
log
(
"返回参数==="
,
rs
.
data
);
if
(
rs
.
status
===
200
&&
rs
.
data
)
{
if
(
rs
.
data
.
respCode
!=
'00000000'
)
{
//验证通过
result
.
code
=
-
120
;
}
return
result
;
}
result
.
data
=
tResult
.
data
;
result
.
code
=
-
110
;
this
.
idauthlogDao
.
create
({
userName
:
params
.
name
,
userIdNo
:
params
.
idno
,
result
:
result
.
code
});
return
result
;
// var result = {
// code: 1,
// message: "success",
// data: {}
// };
// var reqUrl = this.eSignBaoBankVerifyUrl + "/infoauth/psn/identity";
// var tResult = await this.returnResult(params, reqUrl, opName, "personTwo", result);
// if (tResult.errCode != 0) {
// result.code = -110;
// if (tResult.message && tResult.message.indexOf(":") > 0) {
// var tmpListStr = tResult.message.split(':');
// result.message = tmpListStr[1] ? tmpListStr[1] : tmpListStr[0];
// } else {
// result.message = "个人二要素验证失败";
// }
// return result;
// }
// if (tResult.errCode == 0 && tResult.data && !tResult.data.pass) {
// result.code = -120;
// result.message = "姓名或身份证错误";
// return result;
// }
// result.data = tResult.data;
// return result;
}
async
bankthree
(
params
,
opName
)
{
//三要素验证
...
...
@@ -151,6 +216,7 @@ class UtilESignBaoService {
// result.data = tResult.data;
// return result;
}
//
async
bankfour
(
params
,
opName
)
{
//四要素验证
...
...
@@ -1023,6 +1089,7 @@ class UtilESignBaoService {
};
return
result
;
}
/*参数说明:
var params = {
templateId: "2c98d5446734acf5016827d168a6013b", //模板id,由创建模板接口调用返回的templateId 必填
...
...
@@ -1367,4 +1434,5 @@ class UtilESignBaoService {
return
randStr
;
}
}
module
.
exports
=
UtilESignBaoService
;
bpo-web/app/base/service/impl/utillbwSve.js
View file @
1bd516aa
...
...
@@ -83,6 +83,72 @@ class UitlLBWService {
return
result
;
}
async
bankTwoToidCard
(
params
,
opName
){
//二要素(姓名、身份证)
console
.
log
(
opName
,
"兰铂旺二要素验证"
);
var
result
=
{
code
:
1
,
message
:
"success"
,
data
:
{}
};
var
merchantTraceNo
=
await
this
.
getRandomCode
(
32
);
var
merchantRequestTime
=
moment
().
format
(
"YYYY-MM-DD HH:mm:ss"
);
var
bizType
=
"010301"
;
var
encrypt
=
{
"chName"
:
params
.
name
,
//姓名
"idType"
:
"01"
,
"idNum"
:
params
.
idNum
,
//身份证号,
"mchInfo"
:
"汉唐信通(北京)科技有限公司"
,
"riskInfo"
:
params
.
cardno
,
};
var
encryptStr
=
JSON
.
stringify
(
encrypt
);
var
str
=
crypto
.
privateEncrypt
(
this
.
lbwConfig
.
pik
,
Buffer
.
from
(
encryptStr
)).
toString
(
'base64'
);
var
paramMap
=
{};
paramMap
.
merchantId
=
this
.
merchantId
;
paramMap
.
bizType
=
bizType
;
paramMap
.
merchantTraceNo
=
merchantTraceNo
;
paramMap
.
merchantRequestTime
=
merchantRequestTime
;
paramMap
.
encrypt
=
str
;
var
signStr
=
await
this
.
sortParam
(
paramMap
);
var
sign
=
md5
(
signStr
);
var
list
=
{
"merchantId"
:
this
.
merchantId
,
"bizType"
:
bizType
,
"merchantTraceNo"
:
merchantTraceNo
,
"merchantRequestTime"
:
merchantRequestTime
,
"encrypt"
:
str
,
"sign"
:
sign
}
console
.
log
(
"请求参数="
,
list
);
let
rs
=
await
axios
({
url
:
this
.
lbwConfig
.
validate_idcard
,
method
:
'post'
,
data
:
list
,
transformRequest
:
[
function
(
data
)
{
data
=
Qs
.
stringify
(
data
);
return
data
;
}],
headers
:
{
"Content-Type"
:
"application/x-www-form-urlencoded"
},
});
console
.
log
(
"返回状态==="
,
rs
.
status
);
console
.
log
(
"返回参数==="
,
rs
.
data
);
if
(
rs
.
status
===
200
&&
rs
.
data
)
{
if
(
rs
.
data
.
respCode
!=
'00000000'
)
{
//验证通过
result
.
code
=
-
120
;
}
return
result
;
}
result
.
code
=
-
110
;
this
.
idauthlogDao
.
create
({
userName
:
params
.
name
,
userBankNo
:
params
.
cardno
,
result
:
result
.
code
});
return
result
;
}
async
bankthree
(
params
,
opName
)
{
//三要素验证
console
.
log
(
opName
,
"兰铂旺三要素验证"
);
...
...
bpo-web/app/config/settings.js
View file @
1bd516aa
...
...
@@ -127,6 +127,7 @@ var settings = {
let
domain
=
"https://99num.com"
;
return
{
validate_bank
:
`https://99num.com/dsp-simple/api/validate/bank`
,
validate_idcard
:
`https://99num.com/dsp-simple/api/validate/idcard`
,
puk
:
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvuoB1YqsDa1oUlPWZEUe
\
n"
+
"jK1y7Ja4W3AjTLfiqbo9Z6rY7h8ui/CbiZxpJuDg3H0cTI0k8UJWNO+CbYVioLo3
\
n"
+
"bK0Hj10jYkPdzRlQsaQ6gnJaj4DMVjmAjUUsBPnimnGsKvxLwPZTUiOMsVCOWYVH
\
n"
+
...
...
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