Commit 97229de7 by 高宇强

gyq

parent 61c2a0e0
...@@ -500,13 +500,45 @@ class LaoActionApi extends APIBase { ...@@ -500,13 +500,45 @@ class LaoActionApi extends APIBase {
if (!obj.id) { if (!obj.id) {
return system.getResult(null, "参数错误"); return system.getResult(null, "参数错误");
} }
var result = await this.usersSve.updateUserInfo(obj);
if (result == 1) { try{
var user_info = await this.usersSve.findUserInfoByid(obj.id); if (obj.phone_no){
return system.getResult(user_info); var phone_no = this.trim(obj.phone_no);
} else { if (!/^1[23456789]\d{9}$/.test(phone_no)) {
return system.getResult(null, "更新失败"); return system.getResult(null, "手机号码格式不正确");
}
if (obj.vcode){
var vcode = this.trim(obj.vcode);
var key = this.vcodePrev + phone_no;
var code = await this.redisClient.get(key) || "";
if(!code) {
return system.getResult(null, "验证码已失效,请再1分钟之内输入");
}
if(vcode != code) {
return system.getResult(null, "验证码错误,请重新输入");
}
}
else{
return system.getResult(null, "验证码为空,请输入验证码");
}
}
var result = await this.usersSve.updateUserInfo(obj);
if (result == 1) {
var user_info = await this.usersSve.findUserInfoByid(obj.id);
return system.getResult(user_info);
} else {
return system.getResult(null, "更新失败");
}
} }
catch{
return system.getResult(null, "更新失败!");
}
} }
async UpdateLabourStatus(obj) { //更新劳工信息审核状态 async UpdateLabourStatus(obj) { //更新劳工信息审核状态
...@@ -645,15 +677,15 @@ module.exports = LaoActionApi; ...@@ -645,15 +677,15 @@ module.exports = LaoActionApi;
// var tesk = new LaoActionApi(); // var tesk = new LaoActionApi();
// var parm = { // var parm = {
// // find_type:1, // find_type:4,
// // find_info:3, // find_info:"北京"
// //id:2, // //id:2,
// //cur_status:"已过期" // //cur_status:"已过期"
// //memo_text:"sssssssss" // //memo_text:"sssssssss"
// //user_name:"高", // //user_name:"高",
// com_name:"京东" // //com_name:"京东"
// }; // };
// tesk.FindRecruitByWhere(parm).then(function(result){ // tesk.FindRecruitInfo(parm).then(function(result){
// console.log(result); // console.log(result);
// console.log(result.data.rows); // console.log(result.data.rows);
// }).catch(function(e){ // }).catch(function(e){
......
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