Commit 9df6e827 by 赵庆

gsb

parent 20430672
...@@ -22,7 +22,7 @@ class EcontractApi { ...@@ -22,7 +22,7 @@ class EcontractApi {
this.bankthreelogSve = system.getObject("service.bankthreelogSve"); this.bankthreelogSve = system.getObject("service.bankthreelogSve");
this.bankthreelog2Sve = system.getObject("service.bankthreelog2Sve"); this.bankthreelog2Sve = system.getObject("service.bankthreelog2Sve");
this.idcardClient = system.getObject("util.idcardClient");
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.smsS = system.getObject("util.smsClient"); this.smsS = system.getObject("util.smsClient");
} }
...@@ -722,6 +722,21 @@ class EcontractApi { ...@@ -722,6 +722,21 @@ class EcontractApi {
} }
if (!param.idNo) { if (!param.idNo) {
return this.returnjson(-1, "请提供该用户身份证号") return this.returnjson(-1, "请提供该用户身份证号")
}else {
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if(!age) {
return this.returnjson(-1, "请提供该用户身份证号");
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "身份证年龄过大")
}
}
} }
if (!param.bankno) { if (!param.bankno) {
return this.returnjson(-1, "请提供该用户银行卡号") return this.returnjson(-1, "请提供该用户银行卡号")
......
...@@ -15,6 +15,7 @@ class EntcontractApi { ...@@ -15,6 +15,7 @@ class EntcontractApi {
ecid: this.trim(pobj.ecid), ecid: this.trim(pobj.ecid),
appId: this.trim(pobj.appId), appId: this.trim(pobj.appId),
userId: this.trim(pobj.userId), userId: this.trim(pobj.userId),
name: this.trim(pobj.firstName), //甲方 必填 name: this.trim(pobj.firstName), //甲方 必填
addr: this.trim(pobj.firstAddr), //甲方地址 addr: this.trim(pobj.firstAddr), //甲方地址
legal: this.trim(pobj.firstLegal),//甲方法定代表人 legal: this.trim(pobj.firstLegal),//甲方法定代表人
...@@ -40,6 +41,21 @@ class EntcontractApi { ...@@ -40,6 +41,21 @@ class EntcontractApi {
} }
if (!param.idNo) { if (!param.idNo) {
return this.returnjson(-1, "请提供该用户身份证号") return this.returnjson(-1, "请提供该用户身份证号")
}else {
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if(!age) {
return this.returnjson(-1, "请提供该用户身份证号");
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "身份证年龄过大")
}
}
} }
if (!param.bankno) { if (!param.bankno) {
return this.returnjson(-1, "请提供该用户银行卡号") return this.returnjson(-1, "请提供该用户银行卡号")
...@@ -69,7 +85,6 @@ class EntcontractApi { ...@@ -69,7 +85,6 @@ class EntcontractApi {
} }
var signStr = signArr.join("&") + "&key=" + busi.key; var signStr = signArr.join("&") + "&key=" + busi.key;
var sign = md5(signStr).toUpperCase(); var sign = md5(signStr).toUpperCase();
console.log(sign)
if (param.sign != sign) { if (param.sign != sign) {
return this.returnjson(1001001, "签名错误"); return this.returnjson(1001001, "签名错误");
} }
...@@ -111,6 +126,21 @@ class EntcontractApi { ...@@ -111,6 +126,21 @@ class EntcontractApi {
} else { } else {
if (!await this.idcardClient.checkIDCard(param.idNo)) { if (!await this.idcardClient.checkIDCard(param.idNo)) {
return this.returnjson(-1, "身份证格式不正确"); return this.returnjson(-1, "身份证格式不正确");
}else {
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if(!age) {
return this.returnjson(-1, "请提供该用户身份证号");
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "身份证年龄过大")
}
}
} }
} }
if (!param.nonceStr) { if (!param.nonceStr) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment