Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
taxh5
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
data_server
taxh5
Commits
f6677b87
Commit
f6677b87
authored
Apr 23, 2019
by
何娜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taxh5 通知优化
parent
22dec9f0
Pipeline
#6360
passed with stage
in 6 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
+26
-21
partner.js
app/service/partner.js
+26
-21
No files found.
app/service/partner.js
View file @
f6677b87
...
@@ -125,28 +125,33 @@ class PartnerService extends Service {
...
@@ -125,28 +125,33 @@ class PartnerService extends Service {
async
notice
(
order
)
{
async
notice
(
order
)
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
ctx
.
logger
.
info
(
`【Partner】 notice into`
);
ctx
.
logger
.
info
(
`【Partner】 notice into`
);
const
{
orderId
,
notifyUrl
,
userId
,
notice
}
=
order
;
const
{
orderId
,
notifyUrl
,
userId
}
=
order
;
if
(
notifyUrl
&&
notice
!==
'1'
)
{
if
(
notifyUrl
)
{
const
ret
=
await
ctx
.
curl
(
notifyUrl
,
{
try
{
charset
:
'utf-8'
,
const
ret
=
await
ctx
.
curl
(
notifyUrl
,
{
timeout
:
[
'30s'
,
'30s'
],
charset
:
'utf-8'
,
contentType
:
'json'
,
timeout
:
[
'30s'
,
'30s'
],
method
:
'POST'
,
contentType
:
'json'
,
data
:
{
method
:
'POST'
,
orderId
,
data
:
{
userId
,
orderId
,
status
:
'success'
userId
,
},
status
:
'success'
}
},
);
}
ctx
.
logger
.
info
(
`【Partner】 notice
${
notifyUrl
}
`
,
'orderId:'
,
orderId
,
'result:'
,
ret
.
status
,
JSON
.
stringify
(
ret
.
data
));
);
if
(
ret
.
status
==
200
)
{
ctx
.
logger
.
info
(
`【Partner】 notice
${
notifyUrl
}
`
,
'orderId:'
,
orderId
,
'result:'
,
ret
.
status
,
JSON
.
stringify
(
ret
.
data
));
await
order
.
update
({
notice
:
1
});
if
(
ret
.
status
==
200
)
{
}
else
{
await
order
.
update
({
notice
:
1
});
await
order
.
update
({
notice
:
ret
.
status
});
}
else
{
}
await
order
.
update
({
notice
:
ret
.
status
});
}
}
catch
(
e
)
{
ctx
.
logger
.
info
(
`【Partner】 notice err
${
e
}
`
)
}
finally
{
return
}
}
}
return
}
}
}
}
...
...
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