Commit b9a08d3d by 王昆

gsb

parent b5d84e36
......@@ -201,6 +201,74 @@ class BpoSDPJApi {
return system.decryption(no);
}
async qrcodeDesc(obj, req) {
try {
let params = {
appId: obj.appId,
mchtId: obj.mchtId,
ecid: obj.ecid,
outTradeNo: obj.outTradeNo,
nonceStr: obj.nonceStr,
sign: obj.sign,
};
let api = await this.ecompanybusiSve.findOne({
appId: obj.appId,
etemplate_id: obj.ecid,
mchtId: obj.mchtId,
});
if (!api) {
return this.getBaseResult(1001003, "配置信息错误,请联系薪必果人员进行配置");
}
let sign = system.getSign(params, api.key, this.EXCEPT_KEYS);
if (obj.sign != sign) {
return this.getBaseResult(1001001, "签名失败");
}
let cashInfo = await this.ccashinfoSve.findOne({
mchtId: params.mchtId,
outTradeNo: params.outTradeNo,
});
if (!cashInfo) {
return this.getErrResult("二维码不存在");
}
let statusName;
if (cashInfo.qrcode_status == 2) {
statusName = "已失效";
} else if (!cashInfo.trade_status) {
statusName = "待领取";
} else if (cashInfo.trade_status == "00") {
statusName = "已领取";
} else if (cashInfo.trade_status == "01") {
statusName = "领取中";
} else if (cashInfo.trade_status == "02") {
statusName = "领取失败";
} else {
statusName = "状态错误";
}
let dto = {
appId: cashInfo.app_id,
mchtId: cashInfo.mchtId,
outTradeNo: cashInfo.outTradeNo || "",
qrcodeStatus: cashInfo.qrcode_status || "",
tradeStatus: cashInfo.trade_status || "",
tradeDesc: cashInfo.trade_desc,
statusName: statusName,
idName: cashInfo.id_name,
idNo: cashInfo.id_no,
openId: cashInfo.openId,
nonceStr: await this.getUidStr(32, 36)
};
dto.sign = system.getSign(dto, api.key, this.EXCEPT_KEYS);
return this.getSuccessResult("SUCCESS", dto);
} catch (e) {
console.log(e);
return this.getBaseResult(500, "接口异常");
}
return this.getSuccessResult();
}
/**
* 二维码作废
* @param obj
......@@ -609,8 +677,8 @@ class BpoSDPJApi {
if (item.tradeStatus == "00" || item.tradeStatus == "02" || item.tradeStatus == "03") {
// 1 认证页面 2 二维码已失效 3 红包领取页面 4 红包领取结果页面(心跳查询) 5 红包已被领取
let rc;
let trade_desc ;
if(item.tradeStatus == "00") {
let trade_desc;
if (item.tradeStatus == "00") {
rc = 4;
trade_desc = "领取成功";
} else {
......@@ -657,7 +725,7 @@ class BpoSDPJApi {
console.log("-----request smart query ------------", url, params);
let rs = await axios({
method: 'post',
url: url ,
url: url,
data: params,
});
console.log("-----response smart query ------------", rs.data);
......
......@@ -1032,7 +1032,7 @@ class EcontractApi {
}
var signStr = signArr.join("&") + "&key=" + busi.key;
var sign = md5(signStr).toUpperCase();
console.log(signStr, sign);
console.log("---autoSign---签名---", signStr, sign);
if (param.sign != sign) {
return this.returnjson(1001001, "签名错误");
}
......
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