新增手动刷新token方法 #12
This commit is contained in:
1 parent
8f0ddd421c
commit
12fdf6065b
7 files changed
+27
-8
No files matched your search
@@ -61,4 +61,17 @@ public final class TokenHolder {
|
||||
public String getAccessToken() throws WeixinException {
|
||||
return getToken().getAccessToken();
|
||||
}
|
||||
|
||||
/**
|
||||
* 手动刷新token
|
||||
*
|
||||
* @return 刷新后的token
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public Token refreshToken() throws WeixinException {
|
||||
String cacheKey = tokenCreator.getCacheKey();
|
||||
Token token = tokenCreator.createToken();
|
||||
tokenStorager.caching(cacheKey, token);
|
||||
return token;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user