Commit 802cd763 by 王栋源

wdy

parent f677b718
......@@ -160,7 +160,7 @@ class UtilsNeedSve extends AppServiceBase {
"userName": pobj.phone
}
};
var self=this;
var self = this;
// pobj.actionBody.channelUserId = pobj.mobile;//渠道用户id,没有则用手机号
// pobj.actionBody.mobile = pobj.mobile;//用户手机号
var url = settings.centerChannelUrl() + "/api/auth/accessAuth/springBoard";
......@@ -213,5 +213,41 @@ class UtilsNeedSve extends AppServiceBase {
}
}
async orderClose(pobj) {
var sobj = {
"actionType": pobj.action_type,
"actionBody": pobj
}
var self=this;
var tokenInfo = await this.getCenterToken();
if (tokenInfo.status != 0) {
return {
"requestId": self.getUUID(),
"success": false,
"errorMsg": "",
"errorCode": "ok"
};
}
var url = settings.centerChannelUrl() + "/api/opreceive/ic/springBoard";
var token = tokenInfo.data.token;
var rtn = await self.execlient.execPostTK(sobj, url, token);
if (rtn.status == 0) {
return {
"requestId": rtn.requestId,
"success": true,
"errorMsg": "",
"errorCode": "ok"
};
} else {
return {
"requestId": rtn.requestId,
"success": false,
"errorMsg": rtn.msg,
"errorCode": "ok"
};
}
}
}
module.exports = UtilsNeedSve;
......@@ -8,7 +8,7 @@ module.exports = function (app) {
app.use('/api/ali/esp/intention/submit', async function (req, res) {
try {
if (req.headers['content-type'] === 'application/octet-stream') {
if (req.headers['content-type'].indexof('application/octet-stream')>-1 ) {
await logCtl.applicationOctetStream2Json(req);
}
var client_ip = system.get_client_ip(req);
......@@ -34,7 +34,7 @@ module.exports = function (app) {
});
app.use('/api/ali/esp/intention/solution/feedback', async function (req, res) {
try {
if (req.headers['content-type'] === 'application/octet-stream') {
if (req.headers['content-type'].indexof('application/octet-stream')>-1 ) {
await logCtl.applicationOctetStream2Json(req);
}
var client_ip = system.get_client_ip(req);
......@@ -59,7 +59,7 @@ module.exports = function (app) {
});
app.use('/api/ali/ic/paySuccess', async function (req, res) {
try {
if (req.headers['content-type'] === 'application/octet-stream') {
if (req.headers['content-type'].indexof('application/octet-stream')>-1 ) {
await logCtl.applicationOctetStream2Json(req);
}
var client_ip = system.get_client_ip(req);
......@@ -82,9 +82,34 @@ module.exports = function (app) {
});
}
});
app.use('/api/ali/ic/close', async function (req, res) {
try {
if (req.headers['content-type'].indexof('application/octet-stream')>-1 ) {
await logCtl.applicationOctetStream2Json(req);
}
var client_ip = system.get_client_ip(req);
req.body.action_type = "orderClose";
var result = await utilsNeedSve.orderClose(req.body, client_ip);
logCtl.info({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "回调处理订单结果:,method=" + req.body.trxcode,
op: "/api/ali/ic/close",
content: "回调参数:" + JSON.stringify(req.body) + "回调处理订单结果:" + JSON.stringify(result),
clientIp: client_ip || ""
});
res.end(JSON.stringify(result));
return JSON.stringify(result);
} catch (error) {
logCtl.error({
optitle: (new Date()).Format("yyyy-MM-dd hh:mm:ss") + "记录回调处理结果异常:,method=" + req.body.trxcode,
op: "/api/ali/ic/close",
content: "回调参数:" + JSON.stringify(req.body) + "error:" + error.stack,
clientIp: client_ip || ""
});
}
});
app.use('/api/ali/esp/intention/close', async function (req, res) {
try {
if (req.headers['content-type'] === 'application/octet-stream') {
if (req.headers['content-type'].indexof('application/octet-stream')>-1 ) {
await logCtl.applicationOctetStream2Json(req);
}
var client_ip = system.get_client_ip(req);
......
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