index.jsp 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
  2. <%@ page import="com.sgcc.isc.ualogin.client.util.IscSSOResourceUtil" %>
  3. <%@ page import="com.sgcc.isc.ualogin.client.vo.IscSSOUser" %>
  4. <%
  5. String path = request.getContextPath();
  6. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  7. IscSSOUser userbean = IscSSOResourceUtil.getIscUser (request);
  8. System.out.println("用户ID号:"+ userbean.getUserId ());
  9. System.out.println("用户登录名:"+ userbean.getAccount());
  10. System.out.println("用户中文名:"+ userbean.getName());
  11. System.out.println("用户组织id:"+ userbean.getOrgId());
  12. System.out.println("用户登录时间:"+ userbean.getLoginTime());
  13. System.out.println("用户Ticket:"+ userbean.getTicket());
  14. String Ticket = userbean.getTicket();
  15. String loginName = userbean.getAccount();
  16. %>
  17. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  18. <html>
  19. <head>
  20. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  21. <script type="text/javascript" src="/nwyj/scripts/json2.js"></script>
  22. <script type="text/javascript" >
  23. function login() {
  24. //window.location="/nwyj/page/frameWork.html";
  25. var loginName = '<%=loginName%>';
  26. var Ticket = '<%=Ticket%>';
  27. //登录处理
  28. $.ajax({
  29. type: "POST",
  30. url:"/nwyj/ws/sys/LoginService/Login",
  31. data: {"username":loginName},
  32. success: function(data){
  33. if(!!data && data.LoginInfo.st == 0){
  34. window.name = JSON.stringify(data)+'$#$'+Ticket;
  35. //window.name = eval('(' + data + ')');
  36. window.location="/nwyj/page/frameWork.html";
  37. }else{
  38. alert("此用户或密码未通过应急指挥平台认证,请联系管理员。");
  39. window.location="/nwyj/404.jsp";
  40. }
  41. }
  42. });
  43. }
  44. </script>
  45. </head>
  46. <body onload="login()">
  47. </body>
  48. </html>