|
|
@ -201,6 +201,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
jsonObject.put(ModuleConstant.TICKET_UNDERLINE_KEY, componentVerifyTicket); |
|
|
|
String post = HttpClientManager.getInstance().sendPostByJSON(WxMaCodeConstant.API_COMPONENT_TOKEN_URL, JSON.toJSONString(jsonObject)).getData(); |
|
|
|
Map hashMap = JSON.parseObject(post, Map.class); |
|
|
|
if (!hashMap.containsKey(ModuleConstant.ERR_MSG)) { |
|
|
|
String componentAccessToken = hashMap.get(COMPONENT_ACCESS_TOKEN).toString(); |
|
|
|
Integer expiresIn = (Integer) hashMap.get(ModuleConstant.EXPIRES_IN); |
|
|
|
Date expiresInTime = this.countExpirationTime(expiresIn.toString()); |
|
|
@ -221,6 +222,7 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
log.info(ThirdRunTimeInfoConstant.SUCCESS_ACCESS_TOKEN); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 获取预授权码 |
|
|
@ -232,7 +234,6 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
public String preAuthCode() { |
|
|
|
log.info(START_GET_PRE_AUTH_CODE); |
|
|
|
String preAuthCode = ""; |
|
|
|
try { |
|
|
|
String accessToken = redisThird.getComponentAccessToken(); |
|
|
|
JSONObject jsonObject = new JSONObject(); |
|
|
|
jsonObject.put(ModuleConstant.COMPONENT_APPID, componentAppId); |
|
|
@ -255,9 +256,6 @@ public class ComponentVerifyTicketServiceImpl implements ComponentVerifyTicketSe |
|
|
|
} else { |
|
|
|
throw new RuntimeException(FAILURE_GET_PRE_AUTH_CODE); |
|
|
|
} |
|
|
|
} catch (Exception e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
log.info(END_GET_PRE_AUTH_CODE); |
|
|
|
return preAuthCode; |
|
|
|
} |
|
|
|