Commit 2a6f9bbb by 宋毅

tj

parent dca0c16e
const CacheBase=require("../cache.base");
const system=require("../../system");
const CacheBase = require("../cache.base");
const system = require("../../system");
const settings = require("../../../config/settings");
class ApiAccessKeyCache extends CacheBase{
constructor(){
class ApiAccessKeyCache extends CacheBase {
constructor() {
super();
this.restS=system.getObject("util.restClient");
this.restS = system.getObject("util.restClient");
}
desc(){
desc() {
return "应用中缓存访问token";
}
prefix(){
prefix() {
return "g_accesskey_";
}
async buildCacheVal(cachekey,inputkey,val,ex,...items){
var acckapp=await this.restS.execPost({appkey:settings.appKey,secret:settings.secret},settings.paasUrl()+"api/auth/accessAuth/getAccessKey");
var s=acckapp.stdout;
if(s){
var tmp=JSON.parse(s);
if(tmp.status==0){
async buildCacheVal(cachekey, inputkey, val, ex, ...items) {
var acckapp = await this.restS.execPost({ appkey: settings.appKey, secret: settings.secret }, settings.paasUrl() + "api/auth/accessAuth/getAccessKey");
console.log(buildCacheVal, "buildCacheVal..................");
var s = acckapp.stdout;
if (s) {
var tmp = JSON.parse(s);
if (tmp.status == 0) {
return JSON.stringify(tmp.data);
}
}
return null;
}
}
module.exports=ApiAccessKeyCache;
module.exports = ApiAccessKeyCache;
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