Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zhichan
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋勇
zhichan
Commits
802cd763
Commit
802cd763
authored
Mar 22, 2020
by
王栋源
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wdy
parent
f677b718
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
5 deletions
+66
-5
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
+37
-1
igirl-channel-gateway/app/config/routes/api.js
+29
-4
No files found.
igirl-channel-gateway/app/base/service/impl/utilsSve/utilsNeedSve.js
View file @
802cd763
...
...
@@ -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
;
igirl-channel-gateway/app/config/routes/api.js
View file @
802cd763
...
...
@@ -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
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment