|
楼主 |
发表于 2020-11-12 14:28:49
|
显示全部楼层
public static String ssoLogin(String username,String language){
System.out.println("开始执行sslogoin"+username);
Action action = new Action();
action.setProcess("/SA/OPM/system/systemProcess");
action.setActivity("mainActivity");
action.setName("ntLoginAction");
action.setParameter("name", username);
action.setParameter("loginDate", new java.sql.Date(System.currentTimeMillis()));
action.setParameter("ip", "127.0.0.1");
action.setParameter("options", new HashMap<String, Object>());
action.setParameter("lang", language);
try {
ActionResult ar = ActionEngine.invokeActions(JustepConfig.getBusinessServer() + "/login2", null, action.asXML().getBytes("UTF-8"),
null, ActionUtils.XML_CONTENT_TYPE, ActionUtils.XML_CONTENT_TYPE,
null, language, "post", null);
if (ar.isSuccess()){
System.out.println("开始IF"+ar.getBSessionID());
return ar.getBSessionID();
}else{
throw new RuntimeException(ar.getMessage());
}
} catch (Exception e) {
logger.error(e.getMessage()+"", e);
throw new RuntimeException(e.getMessage()+"", e);
}
控制台:
2020-11-12 14:25:39 session 没有超时
2020-11-12 14:25:39 check login end getWeixinBSessionID
2020-11-12 14:25:39
2020-11-12 14:25:39 oauth request
2020-11-12 14:25:39 oauth2callbacki4vLi4vcG9ydGFsL21vYmlsZS9pbmRleC53P3Byb2Nlc3M9L1NBL09QTS9zeXN0ZW0vc3lzdGVtUHJvY2VzcyZhY3Rpdml0eT1tYWluQWN0aXZpdHk=
2020-11-12 14:25:39 userCode:sKGnunFeELkPM0vFK5eyekaEJTfmyKVLqNoaqeYz5cM
2020-11-12 14:25:39 getWeixinBSessionID
2020-11-12 14:25:39 bsessionid:FACC658A5DC41DE89C231BFF0FB1C481
2020-11-12 14:25:39 已经登录过:FACC658A5DC41DE89C231BFF0FB1C481
2020-11-12 14:25:39 session 没有超时
2020-11-12 14:25:39 check login end getWeixinBSessionID
2020-11-12 14:25:39 lizhipeng
开始执行sslogoinlizhipeng
开始IFB6305F295E83456AD447FFF96BD776B8
2020-11-12 14:25:39 ../../portal/mobile/index.w?process=/SA/OPM/system/systemProcess&activity=mainActivity
控制台: |
|