测试修改

master
youhong.ai 2023-12-04 13:47:14 +08:00
parent d975263da7
commit ff1898af99
2 changed files with 5 additions and 1 deletions

View File

@ -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<String, Object> 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();

View File

@ -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")