|
|
@ -35,6 +35,7 @@ public class WaterPortal { |
|
|
|
static String loginUrl = ul + "/uaa/social/sso"; |
|
|
|
static String getUserUrl = ul + "/usrc/open-api/user/page"; |
|
|
|
static String orgUrl = ul + "/usrc/open-api/org/orgPage"; |
|
|
|
static String roleUrl = ul + "/usrc/open-api/role/page"; |
|
|
|
|
|
|
|
|
|
|
|
public static void main(String[] args) throws Exception { |
|
|
@ -46,17 +47,17 @@ public class WaterPortal { |
|
|
|
String signature = timestamp + paasToken + nonce + timestamp; |
|
|
|
signature = SHACoder.encodeSHA256Hex(signature).toUpperCase(); |
|
|
|
|
|
|
|
HttpResponse httpGet = HttpRequest.get(loginUrl) |
|
|
|
.header("x-tsp-target",paasId) |
|
|
|
.header("x-tsp-uid-type","id") |
|
|
|
.header("x-tsp-uid","20231207000003") |
|
|
|
.header("x-tsp-paasid",paasId) |
|
|
|
.header("x-tsp-signature",signature) |
|
|
|
.header("x-tsp-timestamp",timestamp) |
|
|
|
.header("x-tsp-serviceid","DGSP_1606192265703567361") |
|
|
|
.header("x-tsp-nonce", nonce) |
|
|
|
.header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882") |
|
|
|
.execute(); |
|
|
|
// HttpResponse httpGet = HttpRequest.get(loginUrl)
|
|
|
|
// .header("x-tsp-target",paasId)
|
|
|
|
// .header("x-tsp-uid-type","id")
|
|
|
|
// .header("x-tsp-uid","20231207000003")
|
|
|
|
// .header("x-tsp-paasid",paasId)
|
|
|
|
// .header("x-tsp-signature",signature)
|
|
|
|
// .header("x-tsp-timestamp",timestamp)
|
|
|
|
// .header("x-tsp-serviceid","DGSP_1606192265703567361")
|
|
|
|
// .header("x-tsp-nonce", nonce)
|
|
|
|
// .header("x-tsp-appsecret","92c8749c5a424758ba550f3cc79cf882")
|
|
|
|
// .execute();
|
|
|
|
|
|
|
|
//获取用户
|
|
|
|
// HashMap<String, Object> hashMap = new HashMap<>();
|
|
|
@ -89,6 +90,21 @@ public class WaterPortal { |
|
|
|
// .body(JSONObject.toJSONString(hashMap))
|
|
|
|
// .execute();
|
|
|
|
|
|
|
|
|
|
|
|
//获取角色
|
|
|
|
HashMap<String, Object> hashMap = new HashMap<>(); |
|
|
|
hashMap.put("page",1); |
|
|
|
hashMap.put("size",100); |
|
|
|
hashMap.put("systemCode","sgc-jg"); |
|
|
|
HttpResponse httpGet = HttpRequest.post(roleUrl) |
|
|
|
.header("x-tsp-paasid","1732703111547482114") |
|
|
|
.header("x-tsp-signature",signature) |
|
|
|
.header("x-tsp-timestamp",timestamp) |
|
|
|
.header("x-tsp-serviceid","DGSP_1731517609955848193") |
|
|
|
.header("x-tsp-nonce", nonce) |
|
|
|
.header("x-tsp-appsecret","e49e175c07fd4bbe90b3c928772fa58f") |
|
|
|
.body(JSONObject.toJSONString(hashMap)) |
|
|
|
.execute(); |
|
|
|
String body = httpGet.body(); |
|
|
|
JSONObject jsonObject = JSONObject.parseObject(body); |
|
|
|
String records = jsonObject.getJSONObject("data").getString("records"); |
|
|
|