mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-11-02 04:29:48 +08:00
refactor: modify method
This commit is contained in:
@ -43,6 +43,14 @@ public interface WxCpService {
|
||||
*/
|
||||
public void userAuthenticated(String userId) throws WxErrorException;
|
||||
|
||||
/**
|
||||
* 获取access_token, 不强制刷新access_token
|
||||
* @see #getAccessToken(boolean)
|
||||
* @return
|
||||
* @throws WxErrorException
|
||||
*/
|
||||
public String getAccessToken() throws WxErrorException;
|
||||
|
||||
/**
|
||||
* <pre>
|
||||
* 获取access_token,本方法线程安全
|
||||
|
||||
@ -71,6 +71,10 @@ public class WxCpServiceImpl implements WxCpService {
|
||||
execute(new SimpleGetRequestExecutor(), url, null);
|
||||
}
|
||||
|
||||
public String getAccessToken() throws WxErrorException {
|
||||
return getAccessToken(false);
|
||||
}
|
||||
|
||||
public String getAccessToken(boolean forceRefresh) throws WxErrorException {
|
||||
if (forceRefresh) {
|
||||
wxCpConfigStorage.expireAccessToken();
|
||||
|
||||
Reference in New Issue
Block a user