修改项目结构,添加ssoTOken获取示例

master
youhong.ai 2023-11-21 18:28:25 +08:00
parent ebf3a791c2
commit 0f20b6b3b8
3 changed files with 30 additions and 1 deletions

View File

@ -1,4 +1,4 @@
package environment;
package com.weaver.ebu7dev.examples.registertoken;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.asymmetric.KeyType;

View File

@ -0,0 +1,29 @@
package com.weaver.ebu7dev.examples.ssotoken;
import cn.hutool.http.HttpRequest;
/**
* <h1>ssoToken</h1>
*
* <p>create: 2023/11/21 18:03</p>
*
* @author youHong.ai
*/
public class SsoTokenJumpEcology {
/** ecology方提供的appID */
private static final String APP_ID = "NCCloud";
public static void main(String[] args) {
// 注意这里是对应ECOLOGY 系统的地址数据信息
String ecUrlHost = "http://10.86.0.248";
String ssoToken = HttpRequest
.get(ecUrlHost + "/ssologin/checkToken")
.header("appid", APP_ID)
.header("loginid", "1")
.execute().body();
System.out.println("ecology ssoToken is :" + ssoToken);
System.out.println("you can try jump to this url: "+ "http://10.86.0.248/spa/cube/index.html?ssoToken=" + ssoToken + "#/main/cube/search?customid=2000017&billid=278,279");
}
}