login.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  6. <meta http-equiv="pragma" content="no-cache">
  7. <meta http-equiv="Cache-Control" content="no-cache, must-revalidate">
  8. <meta http-equiv="expires" content="0">
  9. <link rel="stylesheet" href="./hisLib/login.css">
  10. <title>控制台</title>
  11. </head>
  12. <body>
  13. <div class="login-center">
  14. <div class="logo"></div>
  15. <div class="login">
  16. <form class="form-horizontal">
  17. <div class="font-center">
  18. <span>登录</span>
  19. </div>
  20. <input type="hidden" name="appId" value="1" />
  21. <input type="hidden" name="resource" value="pc" />
  22. <div class="username">
  23. <input name="userName" placeholder="用户名" type="text" value="admin">
  24. <img src="hisLib/img/user.png" class="img">
  25. </div>
  26. <div class="password">
  27. <input name="password" placeholder="密码" type="password" value="1">
  28. <img src="hisLib/img/password.png" class="img">
  29. </div>
  30. <div class="unitId">
  31. <select name="unitId" id="unitId">
  32. </select>
  33. <img src="hisLib/img/hospital.png" class="img">
  34. </div>
  35. <div class="confirm">
  36. <button onclick="login()" class="btn btn-primary" type="button">确定</button>
  37. </div>
  38. </form>
  39. </div>
  40. </div>
  41. <script src="./hisLib/jquery-1.9.1.min.js"></script>
  42. <!-- 参数定义 -->
  43. <script src="./hisLib/param.js"></script>
  44. <!-- 工具类 -->
  45. <!--<script src="js/login/tools.js"></script>-->
  46. <!-- 页面处理类-->
  47. <!--<script src="js/page.js"></script>-->
  48. </body>
  49. </html>
  50. <script type="text/javascript">
  51. $(function(){
  52. $.ajax({
  53. async: false,
  54. type: "POST",
  55. dataType: "json",
  56. //url: concatToken(Param.host_url + "/sys/unit/select_list"),
  57. url: Param.host_url + "/sys/unit/select_list",
  58. data: '',
  59. success: function(data, textStatus) {
  60. if(data){
  61. var unit = data.data;
  62. var html = "";
  63. $.each(unit,function(){
  64. html += "<option value='"+this.id+"'>"+this.name+"</option>"
  65. })
  66. $("#unitId").append(html);
  67. }
  68. },
  69. error: function(jqXHR){
  70. alert(Param.host_url + "/sys/unit/select_list" + "请求出现例外:" + jqXHR.statusText);
  71. return false;
  72. }
  73. });
  74. });
  75. function login() {
  76. $.extend(Param.formPost, {
  77. isToken: false,
  78. url: '/login',
  79. callback: function(data) {
  80. if (data.ret == "0") {
  81. //Param.initPageUser(data.data);
  82. var num = Math.floor(Math.random()*10000);
  83. self.location.href ="../../?patientNo=1600&doctorNo=1&deptId=N016&recordId="+num+"&hospitalId=A001";
  84. } else {
  85. alert(data.msg);
  86. }
  87. }
  88. });
  89. ajaxLogin(Param.formPost);
  90. }
  91. function ajaxLogin(param_) {
  92. $.extend(Param.formPost, param_);
  93. $.ajax({
  94. async: false,
  95. type: "POST",
  96. dataType: "json",
  97. //url: Param.host_url + (Param.formPost.isToken?concatToken(Param.formPost.url):Param.formPost.url),
  98. url: Param.host_url + Param.formPost.url,
  99. data: $(Param.formPost.formName).serialize(),
  100. success: function(data, textStatus) {
  101. Param.formPost.callback(data);
  102. },
  103. error: function(jqXHR){
  104. alert(Param.formPost.url + "请求出现例外:" + jqXHR.statusText);
  105. }
  106. });
  107. }
  108. </script>