index.jsp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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. String real_name = userbean.getName();
  17. %>
  18. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  19. <html>
  20. <head>
  21. <script type="text/javascript" src="/nwyj/scripts/qui/libs/js/jquery.js"></script>
  22. <script type="text/javascript" src="/nwyj/scripts/json2.js"></script>
  23. <script type="text/javascript" >
  24. function login() {
  25. //window.location="/nwyj/page/frameWork.html";
  26. var loginName = '<%=loginName%>';
  27. var real_name = '<%=real_name%>';
  28. var Ticket = '<%=Ticket%>';
  29. //登录处理
  30. $.ajax({
  31. type: "POST",
  32. url:"/nwyj/ws/sys/LoginService/Login",
  33. data: {"username":loginName,"real_name":real_name},
  34. success: function(data){
  35. if(!!data && data.LoginInfo.st == 0){
  36. window.name = JSON.stringify(data)+'$#$'+Ticket;
  37. //window.name = eval('(' + data + ')');
  38. window.location="/nwyj/page/frameWork.html";
  39. }else{
  40. alert("此用户或密码未通过应急指挥平台认证,请联系管理员。");
  41. window.location="/nwyj/404.jsp";
  42. }
  43. }
  44. });
  45. }
  46. </script>
  47. </head>
  48. <body onload="login()">
  49. </body>
  50. </html>