parent
cfb429d699
commit
268063abab
|
@ -48,10 +48,12 @@ public class BIPService {
|
||||||
RestTemplate restTemplate = new RestTemplate();
|
RestTemplate restTemplate = new RestTemplate();
|
||||||
HttpHeaders httpHeaders = new HttpHeaders();
|
HttpHeaders httpHeaders = new HttpHeaders();
|
||||||
HttpEntity<Object> objectHttpEntity = new HttpEntity<>(httpHeaders);
|
HttpEntity<Object> objectHttpEntity = new HttpEntity<>(httpHeaders);
|
||||||
|
String signature = generateSignature("appKey22564a240d3140d0b15582aca71a748ctimestamp" + currentTimeMillis);
|
||||||
|
logger.info("getBIPToken\ntimestamp:{}\nsignature:{}", currentTimeMillis, signature);
|
||||||
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("https://biptest.ctny.com.cn/iuap-api-auth/open-auth/selfAppAuth/getAccessToken")
|
UriComponentsBuilder builder = UriComponentsBuilder.fromUriString("https://biptest.ctny.com.cn/iuap-api-auth/open-auth/selfAppAuth/getAccessToken")
|
||||||
.queryParam("appKey", "22564a240d3140d0b15582aca71a748c")
|
.queryParam("appKey", "22564a240d3140d0b15582aca71a748c")
|
||||||
.queryParam("timestamp", currentTimeMillis)
|
.queryParam("timestamp", currentTimeMillis)
|
||||||
.queryParam("signature", generateSignature("appKey22564a240d3140d0b15582aca71a748ctimestamp" + currentTimeMillis));
|
.queryParam("signature", signature);
|
||||||
ResponseEntity<String> exchange = restTemplate.exchange(builder.build().toString(), HttpMethod.GET, objectHttpEntity, String.class);
|
ResponseEntity<String> exchange = restTemplate.exchange(builder.build().toString(), HttpMethod.GET, objectHttpEntity, String.class);
|
||||||
JSONObject jsonObject = JSON.parseObject(exchange.getBody());
|
JSONObject jsonObject = JSON.parseObject(exchange.getBody());
|
||||||
if ("00000".equals(jsonObject.getString("code"))){
|
if ("00000".equals(jsonObject.getString("code"))){
|
||||||
|
@ -61,7 +63,7 @@ public class BIPService {
|
||||||
return access_token;
|
return access_token;
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
logger.info("报错信息 error:" + e);
|
||||||
}
|
}
|
||||||
return access_token;
|
return access_token;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue