Commit c602296a authored by 姜登's avatar 姜登

log

parent d8e98005
Pipeline #7173 passed with stage
in 3 seconds
...@@ -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);
} }
......
...@@ -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, {
......
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