新增手动刷新token方法 #12
This commit is contained in:
@@ -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