| @@ -197,7 +197,7 @@ public class TtOpenComponentServiceImpl implements TtOpenComponentService { | |||||
| private String createPreAuthUrl(String redirectURI) throws WxErrorException { | private String createPreAuthUrl(String redirectURI) throws WxErrorException { | ||||
| String uri = API_CREATE_PREAUTHCODE_URL + "?component_appid="+getWxOpenConfigStorage().getComponentAppId(); | String uri = API_CREATE_PREAUTHCODE_URL + "?component_appid="+getWxOpenConfigStorage().getComponentAppId(); | ||||
| String responseContent = post(API_CREATE_PREAUTHCODE_URL, null,"component_access_token"); | |||||
| String responseContent = post(uri, null,"component_access_token"); | |||||
| log.info(responseContent +"----------responseContent"); | log.info(responseContent +"----------responseContent"); | ||||
| JsonObject jsonObject = TtOpenGsonBuilder.create().fromJson(responseContent, JsonObject.class); | JsonObject jsonObject = TtOpenGsonBuilder.create().fromJson(responseContent, JsonObject.class); | ||||
| @@ -247,11 +247,10 @@ public class TtOpenComponentServiceImpl implements TtOpenComponentService { | |||||
| } | } | ||||
| @Override | @Override | ||||
| public String retrieveCode(String authorizationCode) throws WxErrorException { | |||||
| JsonObject jsonObject = new JsonObject(); | |||||
| jsonObject.addProperty("component_appid", getWxOpenConfigStorage().getComponentAppId()); | |||||
| jsonObject.addProperty("authorization_appid", authorizationCode); | |||||
| String responseContent = post(RETRIEVE_AUTHORIZER_TOKEN_URL, jsonObject.toString(), "component_access_token"); | |||||
| public String retrieveCode(String authorizerAppid) throws WxErrorException { | |||||
| String uri = RETRIEVE_AUTHORIZER_TOKEN_URL + "?component_appid=" + getWxOpenConfigStorage().getComponentAppId() + | |||||
| "&authorization_appid=" + authorizerAppid; | |||||
| String responseContent = post(uri, null, "component_access_token"); | |||||
| TtOpenRetrieveCode retrieveCode = TtOpenGsonBuilder.create().fromJson(responseContent, TtOpenRetrieveCode.class); | TtOpenRetrieveCode retrieveCode = TtOpenGsonBuilder.create().fromJson(responseContent, TtOpenRetrieveCode.class); | ||||
| if(retrieveCode == null){ | if(retrieveCode == null){ | ||||
| return null; | return null; | ||||