| | |
| | | new org.springframework.http.HttpEntity<>(headers), |
| | | new ParameterizedTypeReference<Map<String, Object>>() { |
| | | }); |
| | | Assert.isTrue(exchange.getStatusCode().is2xxSuccessful(), "响应必须是 200 成功"); |
| | | log.info(exchange.toString()); |
| | | Map<String, Object> authMap = exchange.getBody(); |
| | | if("200".equals(authMap.get("code"))) { |
| | | try { |
| | | accessToken = authMap.get("access_token").toString(); |
| | | refreshToken = authMap.get("refresh_token").toString(); |
| | | expireTime = Long.valueOf(authMap.get("expires_time").toString()); |
| | | } catch (Exception e) { |
| | | log.error("exchange:" + exchange.toString()); |
| | | throw new RuntimeException("获取平台token异常",e); |
| | | } |
| | | } |
| | | |