|
发表于 2020-6-10 17:44:56
|
显示全部楼层
- public String login() throws UnknownHostException {
- String businessServer = "http://127.0.0.1:8080/BusinessServer";
- String loginName = "system";
- String password = "123456";
-
- // 获得本地IP地址
- String localIP = java.net.InetAddress.getLocalHost().getHostAddress();
- // 初始化动作引擎
- ActionEngine.init(businessServer);
- // 登录
- ActionResult loginResult = ActionEngine.login2(loginName, ActionUtils.md5(password), localIP,null, new Date(System.currentTimeMillis()), new HashMap<String, Object>(), ActionUtils.JSON_CONTENT_TYPE, null);
- String bSessionID = "";
- if (loginResult.isSuccess()){
- bSessionID = loginResult.getBSessionID();
- }else{
- throw new RuntimeException(loginResult.getMessage());
- }
-
- // 返回bSessionID
- return bSessionID;
- }
复制代码 |
|