Commit 8c234ef2 by 赵庆

gsb

parent 9df6e827
......@@ -723,18 +723,21 @@ class EcontractApi {
if (!param.idNo) {
return this.returnjson(-1, "请提供该用户身份证号")
}else {
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, "请提供该用户身份证号");
return this.returnjson(-1, "您的身份证号格式错误, 只支持18位身份证号码");
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
return this.returnjson(-1, "签约失败,男限制18-60岁之间")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "身份证年龄过大")
return this.returnjson(-1, "签约失败,女限制18-55岁之间")
}
}
}
......
......@@ -41,13 +41,16 @@ class EntcontractApi {
}
if (!param.idNo) {
return this.returnjson(-1, "请提供该用户身份证号")
}else {
} else {
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) {
if (!age) {
return this.returnjson(-1, "请提供该用户身份证号");
}
if(card.sex == 'male') {
if (card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
}
......@@ -126,20 +129,19 @@ class EntcontractApi {
} else {
if (!await this.idcardClient.checkIDCard(param.idNo)) {
return this.returnjson(-1, "身份证格式不正确");
}else {
let card = await this.idcardClient.cardInfo(param.idNo);
let age = card.age || 0;
if(!age) {
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岁之间")
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return this.returnjson(-1, "身份证年龄过大")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "身份证年龄过大")
}
} else {
if (age < 18 || age > 55) {
return this.returnjson(-1, "签约失败,女限制18-55岁之间")
}
}
}
......
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