Commit c9fc6ca0 by 王栋源

wdy

parent 27b265fe
...@@ -5,7 +5,7 @@ class PaymentAPI extends APIBase { ...@@ -5,7 +5,7 @@ class PaymentAPI extends APIBase {
constructor() { constructor() {
super(); super();
this.execlient = system.getObject("util.execClient"); this.execlient = system.getObject("util.execClient");
this.centerPaymentUrl = settings.centerPaymentUrl(); this.centerAppUrl = settings.centerAppUrl();
} }
/** /**
...@@ -21,22 +21,24 @@ class PaymentAPI extends APIBase { ...@@ -21,22 +21,24 @@ class PaymentAPI extends APIBase {
if (!pobj.actionType) { if (!pobj.actionType) {
return system.getResult(null, "actionType参数不能为空"); return system.getResult(null, "actionType参数不能为空");
} }
var result = await this.opActionProcess(pobj.actionProcess, pobj.actionType, pobj.actionBody, req); var result = await this.opActionProcess(pobj, pobj.actionType, pobj.actionBody, req);
return result; return result;
} }
async opActionProcess(action_process, action_type, action_body, req) { async opActionProcess(pobj, action_type, action_body, req) {
var opResult = null; var opResult = null;
var url = ""; var url = "";
switch (action_type) { switch (action_type) {
// sy // sy
case "getQrCode"://pc端订单支付二维码生成 case "getQrCode"://pc端订单支付二维码生成
url = this.centerPaymentUrl + "api/payment/paymentApi/getQrCode"; url = this.centerAppUrl + "payment/paymentApi/getQrCode";
break; break;
case "queryOrder"://通联支付查询 case "queryOrder"://通联支付查询
url = this.centerPaymentUrl + "api/payment/paymentApi/queryOrder"; url = this.centerAppUrl + "payment/paymentApi/queryOrder";
break;
case "receiveCallBackNotify"://通联支付查询
url = this.centerAppUrl + "payment/paymentApi/receiveCallBackNotify";
break; break;
default: default:
opResult = system.getResult(null, "action_type参数错误"); opResult = system.getResult(null, "action_type参数错误");
break; break;
...@@ -44,7 +46,7 @@ class PaymentAPI extends APIBase { ...@@ -44,7 +46,7 @@ class PaymentAPI extends APIBase {
if (url) { if (url) {
opResult = system.getResultSuccess(null, "action_type参数错误"); opResult = system.getResultSuccess(null, "action_type参数错误");
} }
var opResultstr = await this.execlient.execPost(action_body, url); var opResultstr = await this.execlient.execPost(pobj, url);
opResult = JSON.parse(opResultstr.stdout) opResult = JSON.parse(opResultstr.stdout)
return opResult; return opResult;
} }
......
...@@ -19,6 +19,11 @@ module.exports = function (app) { ...@@ -19,6 +19,11 @@ module.exports = function (app) {
next(); next();
return; return;
} }
if (req.body.actionType == "receiveCallBackNotify") {
req.body.actionBody.app_hosts = req.host;
next();
return;
}
var token = req.headers["token"] || ""; var token = req.headers["token"] || "";
if (!token) { if (!token) {
result.msg = "req headers token can not be empty"; result.msg = "req headers token can not be empty";
......
...@@ -29,7 +29,7 @@ var settings = { ...@@ -29,7 +29,7 @@ var settings = {
}, },
centerAppUrl: function () { centerAppUrl: function () {
if (this.env == "dev") { if (this.env == "dev") {
return "http://centerapp.apps.com:4010/"; return "http://192.168.18.34:4010/";
} else { } else {
return "https://centerapp/"; return "https://centerapp/";
} }
......
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