Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sb_h5
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
sb_h5
Commits
d850fc68
Commit
d850fc68
authored
Apr 23, 2019
by
高诸锋
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
9e426dc0
Pipeline
#6340
passed with stage
in 3 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
29 deletions
+1
-29
partner.js
app/service/partner.js
+1
-29
No files found.
app/service/partner.js
View file @
d850fc68
...
...
@@ -33,40 +33,12 @@ class PartnerService extends Service {
},
});
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
host
+
fetchTheme
}
/
${
appKey
}
`
,
ret
.
data
);
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
id
===
appKey
)
{
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
[
0
].
appKey
===
appKey
)
{
await
this
.
app
.
cache
.
set
(
redisThemePrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
),
7200
);
}
return
ret
.
data
;
}
async
fetchScripts
(
appKey
)
{
const
{
ctx
,
partnerAPI
:
{
fetchScripts
,
host
,
redisScriptsPrefix
}
}
=
this
;
if
(
appKey
)
{
const
data
=
await
this
.
app
.
cache
.
get
(
redisScriptsPrefix
+
appKey
);
if
(
data
)
{
try
{
return
JSON
.
parse
(
data
);
}
catch
(
err
)
{
ctx
.
logger
.
error
(
'【Partner】 fetchScripts'
,
redisScriptsPrefix
+
appKey
,
'result:'
,
JSON
.
stringify
(
data
),
err
);
await
this
.
app
.
cache
.
del
(
redisScriptsPrefix
+
appKey
);
}
}
}
const
url
=
`
${
host
+
fetchScripts
}
/
${
appKey
}
`
;
const
ret
=
await
ctx
.
curl
(
url
,
{
charset
:
'utf-8'
,
timeout
:
[
'30s'
,
'30s'
],
dataType
:
'json'
,
method
:
'GET'
,
});
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
url
}
`
,
ret
.
data
);
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
id
===
appKey
)
{
await
this
.
app
.
cache
.
set
(
redisScriptsPrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
),
300
);
}
return
ret
.
data
;
}
// 查询结束后回调通知合作方
// 对于状态已经是成功的订单号不会在做通知
// orderId/userId/status
...
...
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