Commit c96a6cf1 authored by 何娜's avatar 何娜

log

parent f6677b87
Pipeline #6372 passed with stage
in 2 seconds
...@@ -49,6 +49,7 @@ class OrderController extends Controller { ...@@ -49,6 +49,7 @@ class OrderController extends Controller {
const { ctx, service } = this; const { ctx, service } = this;
ctx.validate(this.createRule); ctx.validate(this.createRule);
let { appKey, userId, notifyUrl, backUrl, orderId } = ctx.request.body; let { appKey, userId, notifyUrl, backUrl, orderId } = ctx.request.body;
ctx.logger.info('【orders】 appKey', appKey);
const appKeyInfo = await service.partner.fetchInfo(appKey); const appKeyInfo = await service.partner.fetchInfo(appKey);
ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo); ctx.logger.info(appKey, ',appKeyInfo,', appKeyInfo);
if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableIt === true)) { if (!(appKeyInfo && appKeyInfo.valid === true && appKeyInfo.enableIt === true)) {
......
...@@ -43,11 +43,12 @@ class PartnerService extends Service { ...@@ -43,11 +43,12 @@ class PartnerService extends Service {
const { ctx, partnerAPI: { fetchInfo, host, redisInfoPrefix } } = this; const { ctx, partnerAPI: { fetchInfo, host, redisInfoPrefix } } = this;
if (appKey) { if (appKey) {
const data = await this.app.redis.get(redisInfoPrefix + appKey); const data = await this.app.redis.get(redisInfoPrefix + appKey);
ctx.logger.info('【Scripts】fetchInfo redis data', redisInfoPrefix + appKey, 'result:', data);
if (data) { if (data) {
try { try {
return JSON.parse(data); return JSON.parse(data);
} catch (err) { } catch (err) {
ctx.logger.error('【Scripts】fetchInfo', redisInfoPrefix + appKey, 'result:', data, err); ctx.logger.info('【Scripts】fetchInfo redis err', redisInfoPrefix + appKey, 'result:', data, err);
await this.app.redis.del(redisInfoPrefix + appKey); await this.app.redis.del(redisInfoPrefix + appKey);
} }
} }
......
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