您好 请问后续是怎么解决的?
获取access_token 微信接口返回 moved[图片] 这是微信返回的结果, 调用的接口是https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=ID&corpsecret=SECRET 而且这个是偶尔性的。
2021-07-28请问解决了吗
获取openid失败?后台请求https:api.weixin.qq.com/sns/jscode2session?报错,报错信息:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target,请问怎么解决
2021-07-14您好,请教一下这个问题解决了吗,如何解决的?
上传临时素材中文文件名乱码?这是代码 @Test public void testUploadMedia() { FileSystemResource resource = new FileSystemResource("/Users/lanyanhua/Desktop/中文名.jpg"); String mediaId = uploadMedia(resource); System.out.println("mediaId:" + mediaId); //3xyN1by2qk0dVfEwKJ2ZvC4LA38qGprE3xMRbr5U6h2g //3XmJgRO7QE9mH_WCaYNgE4ETur61Few3MKTL79lzCYiWTa_Re2Q2CLX5OsCeYmAg- } /** * 上传临时素材 * * @param resource 文件 * @return media_id,该media_id仅三天内有效 */ public String uploadMedia(FileSystemResource resource) { String url = "https://qyapi.weixin.qq.com/cgi-bin/media/upload?access_token=ACCESS_TOKEN&type=TYPE" .replace("ACCESS_TOKEN", token).replace("TYPE", "image"); RestTemplate restTemplate = new RestTemplate(); MultiValueMap<String, Object> param = new LinkedMultiValueMap<>(); param.add("file", resource); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaType.MULTIPART_FORM_DATA); HttpEntity<MultiValueMap<String, Object>> requestEntity = new HttpEntity<>(param, headers); ResponseEntity<JSONObject> responseEntity = restTemplate.postForEntity(url, requestEntity, JSONObject.class); if (responseEntity.getStatusCode() == HttpStatus.OK) { JSONObject body = responseEntity.getBody(); if (body.getInteger("errcode") == 0) { return body.getString("media_id"); } } throw new BusinessException("上传临时素材失败"); } 获取时名字就是乱码的 [图片]
2021-06-18