Commit f53edbb0 by 王昆

gsb

parent 1386ff55
...@@ -37,6 +37,15 @@ class ecompanywxuserCtl extends CtlBase { ...@@ -37,6 +37,15 @@ class ecompanywxuserCtl extends CtlBase {
if(rs == -101) { if(rs == -101) {
return system.getErrResult2("公司还未配置签约参数"); return system.getErrResult2("公司还未配置签约参数");
} }
if(rs == -102) {
return system.getErrResult2("您的身份证号格式错误, 只支持18位身份证号码");
}
if(rs == -103) {
return system.getErrResult2("签约失败,男限制18-60岁之间");
}
if(rs == -104) {
return system.getErrResult2("签约失败,女限制18-55岁之间");
}
if(rs == -201) { if(rs == -201) {
return system.getErrResult2("提交失败,您填写的身份证号码已经录入系统"); return system.getErrResult2("提交失败,您填写的身份证号码已经录入系统");
......
...@@ -8,6 +8,7 @@ class EcompanywxuserService extends ServiceBase { ...@@ -8,6 +8,7 @@ class EcompanywxuserService extends ServiceBase {
super(ServiceBase.getDaoName(EcompanywxuserService)); super(ServiceBase.getDaoName(EcompanywxuserService));
this.ecompanybusiDao = system.getObject("db.ecompanybusiDao"); this.ecompanybusiDao = system.getObject("db.ecompanybusiDao");
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.idcardClient = system.getObject("util.idcardClient");
} }
async savewxuser(wxuser) { async savewxuser(wxuser) {
...@@ -16,6 +17,20 @@ class EcompanywxuserService extends ServiceBase { ...@@ -16,6 +17,20 @@ class EcompanywxuserService extends ServiceBase {
return -101; return -101;
} }
let card = await this.idcardClient.cardInfo(wxuser.id_no);
let age = card.age || 0;
if(!age) {
return -102;
}
if(card.sex == 'male') {
if (age < 18 || age > 60) {
return -103;
}
} else {
if (age < 18 || age > 55) {
return -104;
}
}
// var idNoUser = await this.dao.findOne({id_no: wxuser.id_no}); // var idNoUser = await this.dao.findOne({id_no: wxuser.id_no});
var user = await this.dao.findOne({openId: wxuser.openId}); var user = await this.dao.findOne({openId: wxuser.openId});
......
...@@ -184,6 +184,7 @@ var app = new Vue({ ...@@ -184,6 +184,7 @@ var app = new Vue({
if (valid) { if (valid) {
//处理登录逻辑 //处理登录逻辑
self.$root.postReq("/web/ecompanywxuserCtl/saveuser", self.wxuser).then(function(d){ self.$root.postReq("/web/ecompanywxuserCtl/saveuser", self.wxuser).then(function(d){
console.log(d);
if(d.status==0) { if(d.status==0) {
self.$message.success("保存成功"); self.$message.success("保存成功");
} else { } else {
......
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