Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gjjh5
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
gjjh5
Commits
c602296a
Commit
c602296a
authored
May 08, 2019
by
姜登
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
log
parent
d8e98005
Pipeline
#7173
passed with stage
in 3 seconds
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
partner.js
app/service/partner.js
+2
-2
scripts.js
app/service/scripts.js
+3
-3
No files found.
app/service/partner.js
View file @
c602296a
...
@@ -32,7 +32,7 @@ class PartnerService extends Service {
...
@@ -32,7 +32,7 @@ class PartnerService extends Service {
subject
:
'hf'
,
subject
:
'hf'
,
},
},
});
});
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
host
+
fetchTheme
}
/
${
appKey
}
`
,
ret
.
data
);
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
host
+
fetchTheme
}
/
${
appKey
}
`
,
JSON
.
stringify
(
ret
.
data
)
);
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
length
>
0
&&
ret
.
data
[
0
].
appKey
===
appKey
)
{
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
length
>
0
&&
ret
.
data
[
0
].
appKey
===
appKey
)
{
await
this
.
app
.
redis
.
set
(
redisThemePrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
[
0
]),
'EX'
,
300
);
await
this
.
app
.
redis
.
set
(
redisThemePrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
[
0
]),
'EX'
,
300
);
}
}
...
@@ -61,7 +61,7 @@ class PartnerService extends Service {
...
@@ -61,7 +61,7 @@ class PartnerService extends Service {
appKey
,
appKey
,
},
},
});
});
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
host
+
fetchInfo
}
?appKey=
${
appKey
}
`
,
ret
.
data
);
ctx
.
logger
.
info
(
`【Partner】 fetchTheme
${
host
+
fetchInfo
}
?appKey=
${
appKey
}
`
,
JSON
.
stringify
(
ret
.
data
)
);
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
length
>
0
&&
ret
.
data
[
0
].
appKey
===
appKey
)
{
if
(
ret
.
status
===
200
&&
ret
.
data
&&
ret
.
data
.
length
>
0
&&
ret
.
data
[
0
].
appKey
===
appKey
)
{
await
this
.
app
.
redis
.
set
(
redisInfoPrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
[
0
]),
'EX'
,
300
);
await
this
.
app
.
redis
.
set
(
redisInfoPrefix
+
appKey
,
JSON
.
stringify
(
ret
.
data
[
0
]),
'EX'
,
300
);
}
}
...
...
app/service/scripts.js
View file @
c602296a
...
@@ -36,7 +36,7 @@ class ScriptsService extends Service {
...
@@ -36,7 +36,7 @@ class ScriptsService extends Service {
dataType
:
'json'
,
dataType
:
'json'
,
contentType
:
'json'
,
contentType
:
'json'
,
});
});
ctx
.
logger
.
info
(
`【Scripts】fetchScripts,
${
baseURL
+
fetchScriptsUrl
}
`
,
'result:'
,
result
.
data
);
ctx
.
logger
.
info
(
`【Scripts】fetchScripts,
${
baseURL
+
fetchScriptsUrl
}
`
,
'result:'
,
JSON
.
stringify
(
result
.
data
)
);
if
(
result
.
data
&&
result
.
data
.
length
>
0
)
{
if
(
result
.
data
&&
result
.
data
.
length
>
0
)
{
await
this
.
app
.
redis
.
set
(
redisScriptsKey
,
JSON
.
stringify
(
result
.
data
),
'EX'
,
120
);
await
this
.
app
.
redis
.
set
(
redisScriptsKey
,
JSON
.
stringify
(
result
.
data
),
'EX'
,
120
);
}
}
...
@@ -86,7 +86,7 @@ class ScriptsService extends Service {
...
@@ -86,7 +86,7 @@ class ScriptsService extends Service {
dataType
:
'json'
,
dataType
:
'json'
,
contentType
:
'json'
,
contentType
:
'json'
,
});
});
ctx
.
logger
.
info
(
`【Scripts】fetchParams,
${
baseURL
+
fetchParamsInfoUrl
}
`
,
'result:'
,
result
.
data
);
ctx
.
logger
.
info
(
`【Scripts】fetchParams,
${
baseURL
+
fetchParamsInfoUrl
}
`
,
'result:'
,
JSON
.
stringify
(
result
.
data
)
);
if
(
result
.
data
&&
result
.
data
.
length
>
0
)
{
if
(
result
.
data
&&
result
.
data
.
length
>
0
)
{
await
this
.
app
.
redis
.
set
(
redisParamsKey
,
JSON
.
stringify
(
result
.
data
),
'EX'
,
300
);
await
this
.
app
.
redis
.
set
(
redisParamsKey
,
JSON
.
stringify
(
result
.
data
),
'EX'
,
300
);
}
}
...
@@ -139,7 +139,7 @@ class ScriptsService extends Service {
...
@@ -139,7 +139,7 @@ class ScriptsService extends Service {
async
fetchCityFormIp
()
{
async
fetchCityFormIp
()
{
const
{
ctx
}
=
this
;
const
{
ctx
}
=
this
;
const
{
ip
}
=
ctx
.
request
;
const
{
ip
}
=
ctx
.
request
;
ctx
.
logger
.
info
(
ctx
.
request
);
ctx
.
logger
.
info
(
JSON
.
stringify
(
ctx
.
request
)
);
const
ipArray
=
ip
.
split
(
','
);
const
ipArray
=
ip
.
split
(
','
);
const
url
=
`https://api.map.baidu.com/location/ip?ak=3TBenWOhPygtFFazaR5kSibU&ip=
${
ipArray
[
0
]}
`
;
const
url
=
`https://api.map.baidu.com/location/ip?ak=3TBenWOhPygtFFazaR5kSibU&ip=
${
ipArray
[
0
]}
`
;
const
result
=
await
ctx
.
curl
(
url
,
{
const
result
=
await
ctx
.
curl
(
url
,
{
...
...
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