Commit 231c8653 by zhaoxiqing

gsb

parent 37d51e32
......@@ -18,7 +18,6 @@ class ecompanywxuserCtl extends CtlBase {
// 通过用户id保存用户,目前只有北京酷酷在用
async saveuser(q, p, req) {
var ecompany_id = Number(p.ecompany_id);
try {
if(!await this.idcardClient.checkIDCard(p.id_no)) {
return system.getErrResult2("您的身份证号格式错误");
......@@ -46,11 +45,19 @@ class ecompanywxuserCtl extends CtlBase {
if(rs == -104) {
return system.getErrResult2("签约失败,女限制18-55岁之间");
}
if(rs == -105){
return system.getErrResult2("推送异常");
}
if(rs == -201) {
return system.getErrResult2("提交失败,您填写的身份证号码已经录入系统");
}
if(rs.code != ''){
return system.getErrResult2(rs.msg);
}
return system.getResult2(rs);
} catch (e) {
console.log(e);
return system.getErrResult2("您的网络不稳, 请稍后重试");
......
......@@ -2,6 +2,7 @@ const system = require("../../system");
const ServiceBase = require("../sve.base");
const moment = require("moment");
const md5 = require("MD5");
const axios = require("axios");
class EcompanywxuserService extends ServiceBase {
constructor() {
......@@ -75,19 +76,35 @@ class EcompanywxuserService extends ServiceBase {
param.sign = md5(signArr.join("&")).toUpperCase();
console.log(JSON.stringify(param));
try {
var rs = await this.restClient.execPost(param, busi.postwxurl);
if (rs.stdout) {
let rsData = JSON.parse(rs.stdout);
if (rsData.code == "0") {
let rs = await axios({
method: 'post',
url: busi.postwxurl,
data: param,
});
if (rs.status == 200) {
let rsData = rs.data;
if (rsData.msg == 'success') {
user.isSend = true;
user.save();
return rsData;
}
return rsData;
}
// var rs = await this.restClient.execPost(param, busi.postwxurl);
// if (rs.stdout) {
// let rsData = JSON.parse(rs.stdout);
// if (rsData.code == "0") {
// user.isSend = true;
// user.save();
// }
// }
} catch (error) {
console.log(error);
}
}
return 1;
return -105;
}
async saveEcidUser(wxuser) {
......
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