添加可选[RedisTokenStorager&添加缓存token时的前缀wx

This commit is contained in:
jinyu
2015-12-10 14:27:30 +08:00
parent dd61596a38
commit ef5fb006f0
16 changed files with 112 additions and 13 deletions
+1 -1
View File
@@ -96,7 +96,7 @@ weixin4j.properties说明
// weixinPayProxy = new WeixinPayProxy(weixinAccount);
weixinPayProxy.orderQuery(idQuery);
> 针对`token`存储有两种方案,`File存储`/`Redis存储`,当然也可自己实现`TokenStorager`,默认使用文件(xml)的方式保存token,如果环境中支持`redis`,建议使用[RedisTokenStorager](https://github.com/foxinmy/weixin4j/wiki/%E7%94%A8redis%E4%BF%9D%E5%AD%98token).
> 针对`token`存储有两种方案,`File存储`/`Redis存储`,当然也可自己实现`TokenStorager`,默认使用文件(xml)的方式保存token,如果环境中支持`redis`,建议使用[RedisTokenStorager](../weixin4j-base/src/main/java/com/foxinmy/weixin4j/token/RedisTokenStorager.java).
>
> WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenStorager());
@@ -42,7 +42,7 @@ public class WeixinJSTicketCreator implements TokenCreator {
@Override
public String getCacheKey() {
return String.format("mp_jsticket_%s", appid);
return String.format("wx_mp_jsticket_%s", appid);
}
@Override
@@ -40,7 +40,7 @@ public class WeixinTokenCreator implements TokenCreator {
@Override
public String getCacheKey() {
return String.format("mp_token_%s", appid);
return String.format("wx_mp_token_%s", appid);
}
@Override
@@ -55,7 +55,7 @@ public class MediaTest extends TokenTest {
@Test
public void download1() throws WeixinException, IOException {
MediaDownloadResult content = mediaApi.downloadMedia(
"V4GvAetzQQjj_ECx1Siqvccgm80a32tk1gRusOBYMk8Uouybl-CwSkGk8w7wKgvI", false);
"nD05mhmkW-SHVS8NfWSxdzJi-6VnVF5YSP5hmMWnKJUxLK5czAWtN4NhVmgEfVoe", false);
Assert.assertTrue(content != null);
System.err.println(content);
}