|
|
|
@ -45,6 +45,12 @@ public class ChiefController {
|
|
|
|
|
@Value("${appkey}")
|
|
|
|
|
private String appkey;
|
|
|
|
|
|
|
|
|
|
@Value("${getInfoId}")
|
|
|
|
|
private String getInfoId;
|
|
|
|
|
|
|
|
|
|
@Value("${getAllInfo}")
|
|
|
|
|
private String getAllInfo;
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
private SingleLoginService singleLoginService;
|
|
|
|
|
|
|
|
|
@ -58,7 +64,6 @@ public class ChiefController {
|
|
|
|
|
String encode = URLEncoder.encode(Base64.encode((HMAC256Config.HmacSHA256(clientId + timespan + userToken, clientSecret))), "UTF-8");
|
|
|
|
|
if (encode.equals(signature)) {
|
|
|
|
|
//经济大脑(政务端)获取用户信息接口
|
|
|
|
|
String url = "https://qyt.sipac.gov.cn/enterprise-gateway/sipsg-enterprise/sys/third/userInfo";
|
|
|
|
|
UserInfoRequestDTO req = new UserInfoRequestDTO();
|
|
|
|
|
req.setClientId(clientId);
|
|
|
|
|
req.setUserToken(userToken);
|
|
|
|
@ -70,7 +75,7 @@ public class ChiefController {
|
|
|
|
|
JSONObject jsonObject = new JSONObject();//存放参数
|
|
|
|
|
jsonObject.set("clientId", clientId);
|
|
|
|
|
jsonObject.set("userToken", userToken);
|
|
|
|
|
HttpResponse response = HttpRequest.post(url)
|
|
|
|
|
HttpResponse response = HttpRequest.post(getInfoId)
|
|
|
|
|
.addHeaders(headers)
|
|
|
|
|
.body(jsonObject.toString())
|
|
|
|
|
.execute();
|
|
|
|
@ -79,7 +84,8 @@ public class ChiefController {
|
|
|
|
|
//经济大脑(政务端)获取用户信息接口
|
|
|
|
|
JSONObject jsonObj = JSONUtil.parseObj(response.body());
|
|
|
|
|
ThirdUserInfoResponse res = JSONUtil.toBean(jsonObj.get("data").toString(), ThirdUserInfoResponse.class);
|
|
|
|
|
String getInfo = "http://uid.sipac.gov.cn/open/api/identity/data/FindUserById?id=" + res.getUserId() + "&appkey=" + appkey;
|
|
|
|
|
//政务通获取用户信息接口(可选)
|
|
|
|
|
String getInfo = getAllInfo+"?id=" + res.getUserId() + "&appkey=" + appkey;
|
|
|
|
|
HttpResponse getMain = HttpRequest.get(getInfo).execute();
|
|
|
|
|
if (getMain.getStatus() == 200) {
|
|
|
|
|
JSONObject dataJson = JSONUtil.parseObj(getMain.body());
|
|
|
|
|