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
460b0aa9
Commit
460b0aa9
authored
Apr 16, 2020
by
zhaoxiqing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gsb
parent
62fc7de1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
82 deletions
+82
-82
bpo-web/app/base/api/impl/yzcontractApi.js
+82
-82
No files found.
bpo-web/app/base/api/impl/yzcontractApi.js
View file @
460b0aa9
...
@@ -22,90 +22,90 @@ class YZContractApi {
...
@@ -22,90 +22,90 @@ class YZContractApi {
return
"start success"
;
return
"start success"
;
}
}
async
merchantSign
(
pobj
)
{
// async merchantSign(pobj) {
// 处理参数
// // 处理参数
var
param
=
{
// var param = {
ecid
:
this
.
trim
(
pobj
.
ecid
),
// ecid: this.trim(pobj.ecid),
appId
:
this
.
trim
(
pobj
.
appId
),
// appId: this.trim(pobj.appId),
merchantId
:
this
.
trim
(
pobj
.
merchantId
),
// merchantId: this.trim(pobj.merchantId),
//
// merchantName: this.trim(pobj.merchantName), //甲方 必填
// merchantAddr: this.trim(pobj.merchantAddr), //甲方地址
// merchantLegal: this.trim(pobj.merchantLegal),//甲方法定代表人
//
// idName: this.trim(pobj.idName),// 代理人姓名
// mobile: this.trim(pobj.mobile),// 代理人手机号
// idNo: this.trim(pobj.idNo),// 代理人身份证
// nonceStr: this.trim(pobj.nonceStr),//随机码
// sign: this.trim(pobj.sign)
// };
//
// if (!param.ecid) {
// return this.returnjson(-1, "请传入薪必果提供的ecid")
// }
// if (!param.appId) {
// return this.returnjson(-1, "请传入薪必果提供的appId")
// }
// if (!param.idName) {
// return this.returnjson(-1, "请提供代理人姓名")
// }
// if (!param.idNo) {
// return this.returnjson(-1, "请提供代理人身份证号")
// }
// if (!await this.idcardClient.checkIDCard(param.idNo)) {
// return this.returnjson(-1, "代理人身份证格式不正确");
// }
// let card = await this.idcardClient.cardInfo(param.idNo);
// let age = card.age || 0;
// if (!age) {
// return this.returnjson(-1, "代理人身份证号格式错误, 只支持18位身份证号码");
// }
// if (card.sex == 'male') {
// if (age < 18 || age > 60) {
// return this.returnjson(-1, "签约失败,男性代理人限制18-60岁之间")
// }
// } else {
// if (age < 18 || age > 55) {
// return this.returnjson(-1, "签约失败,女性代理人限制18-55岁之间")
// }
// }
//
// if (!param.nonceStr) {
// return this.returnjson(-1, "请提供随机码")
// }
//
// var enttemplate = await this.enttemplateSve.findById(param.ecid);
//
// if (!enttemplate || !enttemplate.key) {
// return this.returnjson(1001003, "配置信息错误,请联系薪必果人员进行配置");
// }
// // 签名
// var signArr = [];
// var keys = Object.keys(param).sort();
// for (var i = 0; i < keys.length; i++) {
// var k = keys[i];
// var v = param[k];
// if (!k || !v || k == 'sign') {
// continue;
// }
// signArr.push(k + "=" + v);
// }
// var signStr = signArr.join("&") + "&key=" + enttemplate.key;
// var sign = md5(signStr).toUpperCase();
// console.log(sign)
// if (param.sign != sign) {
// return this.returnjson(1001001, "签名错误");
// }
// try {
// var result = await this.entcontractSve.yzMerchantAutoSign(param);
// return result;
// } catch (error) {
// console.log(error);
// }
// }
merchantName
:
this
.
trim
(
pobj
.
merchantName
),
//甲方 必填
merchantAddr
:
this
.
trim
(
pobj
.
merchantAddr
),
//甲方地址
merchantLegal
:
this
.
trim
(
pobj
.
merchantLegal
),
//甲方法定代表人
idName
:
this
.
trim
(
pobj
.
idName
),
// 代理人姓名
async
merchantSign
(
pobj
)
{
mobile
:
this
.
trim
(
pobj
.
mobile
),
// 代理人手机号
idNo
:
this
.
trim
(
pobj
.
idNo
),
// 代理人身份证
nonceStr
:
this
.
trim
(
pobj
.
nonceStr
),
//随机码
sign
:
this
.
trim
(
pobj
.
sign
)
};
if
(
!
param
.
ecid
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的ecid"
)
}
if
(
!
param
.
appId
)
{
return
this
.
returnjson
(
-
1
,
"请传入薪必果提供的appId"
)
}
if
(
!
param
.
idName
)
{
return
this
.
returnjson
(
-
1
,
"请提供代理人姓名"
)
}
if
(
!
param
.
idNo
)
{
return
this
.
returnjson
(
-
1
,
"请提供代理人身份证号"
)
}
if
(
!
await
this
.
idcardClient
.
checkIDCard
(
param
.
idNo
))
{
return
this
.
returnjson
(
-
1
,
"代理人身份证格式不正确"
);
}
let
card
=
await
this
.
idcardClient
.
cardInfo
(
param
.
idNo
);
let
age
=
card
.
age
||
0
;
if
(
!
age
)
{
return
this
.
returnjson
(
-
1
,
"代理人身份证号格式错误, 只支持18位身份证号码"
);
}
if
(
card
.
sex
==
'male'
)
{
if
(
age
<
18
||
age
>
60
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,男性代理人限制18-60岁之间"
)
}
}
else
{
if
(
age
<
18
||
age
>
55
)
{
return
this
.
returnjson
(
-
1
,
"签约失败,女性代理人限制18-55岁之间"
)
}
}
if
(
!
param
.
nonceStr
)
{
return
this
.
returnjson
(
-
1
,
"请提供随机码"
)
}
var
enttemplate
=
await
this
.
enttemplateSve
.
findById
(
param
.
ecid
);
if
(
!
enttemplate
||
!
enttemplate
.
key
)
{
return
this
.
returnjson
(
1001003
,
"配置信息错误,请联系薪必果人员进行配置"
);
}
// 签名
var
signArr
=
[];
var
keys
=
Object
.
keys
(
param
).
sort
();
for
(
var
i
=
0
;
i
<
keys
.
length
;
i
++
)
{
var
k
=
keys
[
i
];
var
v
=
param
[
k
];
if
(
!
k
||
!
v
||
k
==
'sign'
)
{
continue
;
}
signArr
.
push
(
k
+
"="
+
v
);
}
var
signStr
=
signArr
.
join
(
"&"
)
+
"&key="
+
enttemplate
.
key
;
var
sign
=
md5
(
signStr
).
toUpperCase
();
console
.
log
(
sign
)
if
(
param
.
sign
!=
sign
)
{
return
this
.
returnjson
(
1001001
,
"签名错误"
);
}
try
{
var
result
=
await
this
.
entcontractSve
.
yzMerchantAutoSign
(
param
);
return
result
;
}
catch
(
error
)
{
console
.
log
(
error
);
}
}
async
merchantSigns
(
pobj
)
{
// 处理参数
// 处理参数
var
param
=
{
var
param
=
{
ecid
:
this
.
trim
(
pobj
.
ecid
),
ecid
:
this
.
trim
(
pobj
.
ecid
),
...
...
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