Commit eb42dcc8 by 庄冰

wxtoken

parent 7e6de198
......@@ -7,7 +7,7 @@ const system=require("../../system");
class WxTokenCache extends CacheBase{
constructor(){
super();
this.prefix="wx_wx8aa8a8d4ff3da8bd";
this.prefix="wx_policy_wx8aa8a8d4ff3da8bd";
this.restClient = system.getObject("util.restClient");
this.wxTokenSve = system.getObject("service.common.wxTokenSve");
}
......@@ -15,7 +15,7 @@ class WxTokenCache extends CacheBase{
return "应用UI配置缓存";
}
prefix() {
return "wx_policy_token_wx8aa8a8d4ff3da8bd";
return "wx_policy_wx8aa8a8d4ff3da8bd";
}
async get(){//公众号appid
var key = this.prefix;
......@@ -30,7 +30,9 @@ class WxTokenCache extends CacheBase{
console.log(newobj);
if(newobj && newobj.access_token){
var newobjstring=JSON.stringify(newobj);
await this.redisClient.rpushWithEx(key,newobjstring,7000);
// await this.redisClient.set(key,newobjstring);
// this.redisClient.client.expire(key, 7000);
await this.redisClient.setWithEx(key,newobjstring,7000);
return newobj;
}else{
return null;
......
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