Commit 640d5b96 by 宋毅

Merge branch 'center-channel' of gitlab.gongsibao.com:jiangyong/zhichan into center-channel

parents 6fcf3e25 f516ceb1
...@@ -5,6 +5,7 @@ class SignService{ ...@@ -5,6 +5,7 @@ class SignService{
constructor() { constructor() {
this.centerAppUrl = settings.centerAppUrl(); this.centerAppUrl = settings.centerAppUrl();
this.restClient = system.getObject("util.restClient"); this.restClient = system.getObject("util.restClient");
this.redisClient = system.getObject("util.redisClient");
} }
async restPostUrl(pobj, url) { async restPostUrl(pobj, url) {
try { try {
...@@ -20,9 +21,23 @@ class SignService{ ...@@ -20,9 +21,23 @@ class SignService{
} }
} }
async getAppInfoByAppKey(appkey){ async getAppInfoByAppKey(appkey){
let url = this.centerAppUrl + 'payment/paymentApi/getAppInfoByAppKey'; try {
let appInfoRt = await this.restPostUrl({ appKey: appkey }, url); var shaStr = "getAppInfoByAppKey_"+appkey;
return appInfoRt; var cacheRes = await this.redisClient.get(shaStr);
if (cacheRes) {
return JSON.parse(cacheRes);
}
let url = this.centerAppUrl + 'payment/paymentApi/getAppInfoByAppKey';
let appInfoRt = await this.restPostUrl({ appKey: appkey }, url);
if(appInfoRt && appInfoRt.status==0){
//保存缓存
await this.redisClient.setWithEx(shaStr, JSON.stringify(appInfoRt), 3600);
}
return appInfoRt;
} catch (error) {
var errres = system.getResultFail("获取应用信息失败!");
return errres;
}
} }
/** /**
* 验证签名 * 验证签名
......
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