微信获取上下文token,错误码:61024

//通过appid等信息去微信拿取token
public WechatMiniProgramComponent getTokenFromWX(){
String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+WechatBaseConstant.COMPONENT_APP_ID+"&secret="+WechatBaseConstant.COMPONENT_APP_SECRET;
HttpUriRequest httpUriRequest = RequestBuilder.get().setHeader(new BasicHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()))
.setUri(url)
.build();
Map map = LocalHttpClient.executeJsonResult(httpUriRequest,Map.class);
logger.debug("拿取上下文token返回值:"+map);
WechatMiniProgramComponent entity = new WechatMiniProgramComponent();
entity.setComponentAccessToken(map.get("access_token").toString());
entity.setExpiresIn(Integer.valueOf(map.get("expires_in").toString()));
entity.setExpiresInDate(DateFormart.getExpireDate(entity.getExpiresIn()));
logger.debug("拿取上下文token:"+entity);
return entity;

}


代码,有大神帮我看看吗

你可能感兴趣的:(微信获取上下文token,错误码:61024)