From ff1898af995f979e8e9ac0521895166a2fec08c6 Mon Sep 17 00:00:00 2001 From: "youhong.ai" Date: Mon, 4 Dec 2023 13:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examples/registertoken/RegisterEcologyAndTokenUtil.java | 3 +++ .../weaver/ebu7dev/examples/ssotoken/SsoTokenJumpEcology.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/weaver/ebu7dev/examples/registertoken/RegisterEcologyAndTokenUtil.java b/src/main/java/com/weaver/ebu7dev/examples/registertoken/RegisterEcologyAndTokenUtil.java index f4d6aaa..8c01144 100644 --- a/src/main/java/com/weaver/ebu7dev/examples/registertoken/RegisterEcologyAndTokenUtil.java +++ b/src/main/java/com/weaver/ebu7dev/examples/registertoken/RegisterEcologyAndTokenUtil.java @@ -53,6 +53,7 @@ public class RegisterEcologyAndTokenUtil { String data = HttpRequest .get(ecUrlHost + "/api/hrm/organization/getCompanyFormField") .header("appid", APP_ID) + .header("Content-Type","application/x-www-form-urlencoded;charset=utf-8") .header("token", token) .header("userid", encryptUserid) .execute().body(); @@ -82,6 +83,7 @@ public class RegisterEcologyAndTokenUtil { String data = HttpRequest.post(ecUrlHost + "/api/ec/dev/auth/regist") .header("appid", APP_ID) .header("cpk", publicKey) + .header("Content-Type","application/x-www-form-urlencoded;charset=utf-8") .timeout(2000) .execute().body(); Map datas = JSONUtil.parseObj(data); @@ -117,6 +119,7 @@ public class RegisterEcologyAndTokenUtil { String encryptSecret = rsa.encryptBase64(secret, StandardCharsets.UTF_8, KeyType.PublicKey); String data = HttpRequest.post(ecUrlHost + "/api/ec/dev/auth/applytoken") .header("appid", APP_ID) + .header("Content-Type","application/x-www-form-urlencoded;charset=utf-8") .header("secret", encryptSecret) .header("time", "3600") .execute().body(); diff --git a/src/main/java/com/weaver/ebu7dev/examples/ssotoken/SsoTokenJumpEcology.java b/src/main/java/com/weaver/ebu7dev/examples/ssotoken/SsoTokenJumpEcology.java index d1a59ef..e7a8f24 100644 --- a/src/main/java/com/weaver/ebu7dev/examples/ssotoken/SsoTokenJumpEcology.java +++ b/src/main/java/com/weaver/ebu7dev/examples/ssotoken/SsoTokenJumpEcology.java @@ -12,7 +12,7 @@ import cn.hutool.http.HttpRequest; public class SsoTokenJumpEcology { /** ecology方提供的appID */ - private static final String APP_ID = "2beecb36-71ab-4af8-9762-484ee2cb449b"; + private static final String APP_ID = "1e18329f-820f-11ee-b7a0-cc208c8416bc"; public static void main(String[] args) { @@ -20,6 +20,7 @@ public class SsoTokenJumpEcology { String ecUrlHost = "http://10.86.0.248"; String ssoToken = HttpRequest .post(ecUrlHost + "/ssologin/getToken") + .header("Content-Type","application/x-www-form-urlencoded;charset=utf-8") //.header("Content-Type", "application/x-www-form-urlencoded") .form("appid", APP_ID) .form("loginid", "sysadmin")