Commit 914f780d by 孙亚楠

d

parents cd24818e fc15a4cd
...@@ -24,11 +24,13 @@ class BpoSDPJApi { ...@@ -24,11 +24,13 @@ class BpoSDPJApi {
this.EXCEPT_KEYS = ['sign']; this.EXCEPT_KEYS = ['sign'];
this.ccashinfoSve = system.getObject("service.ccashinfoSve"); this.ccashinfoSve = system.getObject("service.ccashinfoSve");
// this.ecompanybusiSve = system.getObject("service.ecompanybusiSve");
this.ecompanybusiDao = system.getObject("db.ecompanybusiDao"); this.ecompanybusiDao = system.getObject("db.ecompanybusiDao");
this.qrClient = system.getObject("util.qrClient"); this.qrClient = system.getObject("util.qrClient");
this.idcardClient = system.getObject("util.idcardClient"); this.idcardClient = system.getObject("util.idcardClient");
this.esettleSve = system.getObject("service.esettleSve"); this.esettleSve = system.getObject("service.esettleSve");
this.ecompanybusiSve = system.getObject("service.ecompanybusiSve");
this.tdevApi = require("./tdevApi"); this.tdevApi = require("./tdevApi");
this.redisLock = system.getObject("util.redisLock"); this.redisLock = system.getObject("util.redisLock");
this.bankthreelogSve = system.getObject("service.bankthreelogSve"); this.bankthreelogSve = system.getObject("service.bankthreelogSve");
...@@ -55,31 +57,43 @@ class BpoSDPJApi { ...@@ -55,31 +57,43 @@ class BpoSDPJApi {
*/ */
async cashQRCode(obj, req) { async cashQRCode(obj, req) {
// 验证合法性 // 验证合法性
// let p = { let param = {
// appId: this.trim(obj.appId), appId: obj.appId,
// nonceStr: this.trim(obj.nonceStr), ecid: obj.ecid,
// ecid: Number(obj.ecid || 0), mchtId: obj.mchtId,
// idNo: this.trim(obj.idNo), amt: obj.amt,
// }; idName: obj.idName,
// idNo: obj.idNo,
// let keys = Object.keys(p).sort(); outTradeNo: obj.outTradeNo,
// let signArr = []; nonceStr: obj.nonceStr
// for (let k = 0; k < keys.length; k++) { };
// let tKey = keys[k];
// if (this.EXCEPT_KEYS.indexOf(tKey) == -1 && p[tKey]) { let api = await this.ecompanybusiSve.findOne({
// signArr.push(tKey + "=" + p[tKey]); appId: obj.appId,
// } etemplate_id: obj.ecid,
// } mchtId: obj.mchtId,
// let signStr = signArr.join("&") + "&key=" + api.app_secret; });
// let sign = md5(signStr).toUpperCase(); if (!api) {
// console.log(obj.sign, signStr, sign); return this.getBaseResult(1001003, "配置信息错误,请联系薪必果人员进行配置");
// }
// if (sign != obj.sign) {
// return { let keys = Object.keys(param).sort();
// code: 1001001, let signArr = [];
// msg: "签名失败" for (let k = 0; k < keys.length; k++) {
// }; let tKey = keys[k];
// } if (this.EXCEPT_KEYS.indexOf(tKey) == -1 && param[tKey]) {
signArr.push(tKey + "=" + param[tKey]);
}
}
let signStr = signArr.join("&") + "&key=" + api.key;
let sign = md5(signStr).toUpperCase();
console.log(obj.sign, signStr, sign);
if (sign != obj.sign) {
return this.getBaseResult(1001001, "签名失败");
}
try { try {
if(!obj || !obj.outTradeNo || !obj.mchtId){ if(!obj || !obj.outTradeNo || !obj.mchtId){
return this.getCodeResult(1002001,null); return this.getCodeResult(1002001,null);
......
...@@ -17,7 +17,7 @@ class QrClient{ ...@@ -17,7 +17,7 @@ class QrClient{
if(!text){ if(!text){
return null; return null;
} }
let key = "_"+new Date().getTime(), filePath = settings.localPath(); let key = "_" + new Date().getTime(), filePath = settings.localPath();
var qr_png = qr.image(text, {size :10 }); var qr_png = qr.image(text, {size :10 });
let _r = await qr_png.pipe(require('fs').createWriteStream(`${filePath}${key}.png`)); let _r = await qr_png.pipe(require('fs').createWriteStream(`${filePath}${key}.png`));
console.log(_r); console.log(_r);
......
...@@ -35,7 +35,7 @@ var settings = { ...@@ -35,7 +35,7 @@ var settings = {
let rootPath = ""; let rootPath = "";
// windows // windows
if (platform.toLocaleLowerCase().startsWith('win')) { if (platform.toLocaleLowerCase().startsWith('win')) {
rootPath = "C:\\Temp\\"; rootPath = "D:/tmp";
} else { } else {
rootPath="/tmp" rootPath="/tmp"
} }
......
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