mirror of
				https://gitee.com/binary/weixin-java-tools.git
				synced 2025-11-01 00:46:54 +08:00 
			
		
		
		
	🐛 #2171【企业微信】第三方应用CORP_JSAPI_TICKET ,SUITE_JSAPI_TICKET 获取 ticket 失效修复
This commit is contained in:
		| @@ -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请求. | ||||
|    * | ||||
|   | ||||
| @@ -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); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 ParkerJX
					ParkerJX