|
|
@@ -62,11 +62,13 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
log.info("clientId is {}, userName is {}",clientId,userName); |
|
|
|
|
|
|
|
if(ThirdConstant.TUOHENG_AIRPORT_ADMIN.equals(clientId) && StringUtils.isEmpty(userName) && userName.equals("jnbigdata")){ |
|
|
|
log.info("enterjnbigdata"); |
|
|
|
username = "jnbigdata"; |
|
|
|
password = "thjs2023"; |
|
|
|
}else if(ThirdConstant.TUOHENG_AIRPORT_ADMIN.equals(clientId)){ |
|
|
|
// username = "jnbigdata"; |
|
|
|
// password = "thjs2023"; |
|
|
|
log.info("enterclientId"); |
|
|
|
username = "jnbigdata"; |
|
|
|
password = "thjs2023"; |
|
|
|
username = ThirdConstant.GZJJ_USERNAME; |
|
|
|
password = ThirdConstant.GZJJ_PASSWORD; |
|
|
|
}else if(ThirdConstant.TUOHENG_TELECOMUMALE_ADMIN.equals(clientId)){ |
|
|
@@ -76,6 +78,7 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
return JsonResult.error("clientId error"); |
|
|
|
} |
|
|
|
|
|
|
|
log.info("userName is {},password is {}" , username,password); |
|
|
|
//通过oidc的密码模式获取授权token 等相关信息数据 |
|
|
|
TokenResult tokenResult = getToken(clientId,username,password); |
|
|
|
tokenResult.setUserName(username); |
|
|
@@ -116,7 +119,13 @@ public class ThirdServiceImpl implements ThirdService { |
|
|
|
headers.add("Authorization", "Basic " + authorization); |
|
|
|
HttpEntity<MultiValueMap<String, String>> httpEntity = new HttpEntity(params, headers); |
|
|
|
|
|
|
|
String jsonString = JSONObject.toJSONString(params); |
|
|
|
String jsonString1 = JSONObject.toJSONString(headers); |
|
|
|
log.info("sign json is " + jsonString); |
|
|
|
log.info("sign json1 is " + jsonString1); |
|
|
|
|
|
|
|
ResponseEntity<TokenResult> response = restTemplate.exchange(url, HttpMethod.POST, httpEntity, parameterizedTypeReference); |
|
|
|
log.info("sign result is " + JSONObject.toJSONString(response)); |
|
|
|
return response.getBody(); |
|
|
|
} |
|
|
|
|