🐛 #2171【企业微信】第三方应用CORP_JSAPI_TICKET ,SUITE_JSAPI_TICKET 获取 ticket 失效修复

This commit is contained in:
ParkerJX 2021-06-26 21:08:48 +08:00 committed by GitHub
parent b6d4b5e902
commit e3f785f006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View File

@ -255,6 +255,17 @@ public interface WxCpTpService {
*/
String get(String url, String queryParam) throws WxErrorException;
/**
* 当本Service没有实现某个API的时候可以用这个针对所有微信API中的GET请求.
*
* @param url 接口地址
* @param queryParam 请求参数
* @param withoutSuiteAccessToken 请求是否忽略SuiteAccessToken 默认不忽略-false
* @return the string
* @throws WxErrorException the wx error exception
*/
String get(String url, String queryParam, boolean withoutSuiteAccessToken) throws WxErrorException;
/**
* 当本Service没有实现某个API的时候可以用这个针对所有微信API中的POST请求.
*

View File

@ -146,7 +146,7 @@ public abstract class BaseWxCpTpServiceImpl<H, P> implements WxCpTpService, Requ
if (this.configStorage.isAuthSuiteJsApiTicketExpired(authCorpId)) {
String resp = get(configStorage.getApiUrl(GET_SUITE_JSAPI_TICKET),
"type=agent_config&access_token=" + this.configStorage.getAccessToken(authCorpId));
"type=agent_config&access_token=" + this.configStorage.getAccessToken(authCorpId), true);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get("errcode").getAsInt() == 0) {
@ -176,7 +176,7 @@ public abstract class BaseWxCpTpServiceImpl<H, P> implements WxCpTpService, Requ
if (this.configStorage.isAuthCorpJsApiTicketExpired(authCorpId)) {
String resp = get(configStorage.getApiUrl(GET_AUTH_CORP_JSAPI_TICKET),
"access_token=" + this.configStorage.getAccessToken(authCorpId));
"access_token=" + this.configStorage.getAccessToken(authCorpId), true);
JsonObject jsonObject = GsonParser.parse(resp);
if (jsonObject.get("errcode").getAsInt() == 0) {
@ -303,6 +303,11 @@ public abstract class BaseWxCpTpServiceImpl<H, P> implements WxCpTpService, Requ
return execute(SimpleGetRequestExecutor.create(this), url, queryParam);
}
@Override
public String get(String url, String queryParam, boolean withoutSuiteAccessToken) throws WxErrorException {
return execute(SimpleGetRequestExecutor.create(this), url, queryParam, withoutSuiteAccessToken);
}
@Override
public String post(String url, String postData) throws WxErrorException {
return execute(SimplePostRequestExecutor.create(this), url, postData,false);