login.html 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title><{if $title}><{$title}><{/if}></title>
  6. <link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/css/admin_style.css">
  7. <script src="<{$web_cfg.cdn}>/kissy/1.4.0/seed.js?t=1408326831" data-config="{combine:false}" charset="utf-8"></script>
  8. <script src="<{$web_cfg.cdn}>/cfg-min.js?t=1408326831" data-config="{combine:false}" charset="utf-8"></script>
  9. <script src="<{$web_cfg.domain}>/kissy-versions.php" charset="utf-8"></script>
  10. </head>
  11. <style>
  12. html {
  13. box-sizing: border-box;
  14. padding-top: 0;
  15. }
  16. body {
  17. background: none repeat scroll 0 0 #f1f1f1;
  18. color: #444;
  19. font-family: "Open Sans",sans-serif;
  20. font-size: 13px;
  21. line-height: 1.4em;
  22. min-width: 0;
  23. font-family: "Open Sans",sans-serif;
  24. }
  25. #login {
  26. margin: auto;
  27. padding: 8% 0 0;
  28. width: 320px;
  29. }
  30. .login h1 {
  31. color: #777;
  32. font-size: 30px;
  33. margin: 0;
  34. text-align: center;
  35. margin: 0 0 25px;
  36. }
  37. .login .message {
  38. background-color: #fff;
  39. border-left: 4px solid #2ea2cc;
  40. box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
  41. }
  42. #login_error, .login .message {
  43. margin-left: 0;
  44. padding: 12px;
  45. }
  46. .login #login_error {
  47. background: none repeat scroll 0 0 #fff;
  48. border-left: 4px solid #dd3d36;
  49. box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
  50. display:none;
  51. }
  52. .login .form {
  53. background: none repeat scroll 0 0 #fff;
  54. box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
  55. font-weight: 400;
  56. margin-left: 0;
  57. margin-top: 20px;
  58. overflow: hidden;
  59. padding: 26px 24px 46px;
  60. }
  61. #login .form p {
  62. margin-bottom: 0;
  63. }
  64. .login label {
  65. color: #777;
  66. font-size: 14px;
  67. font-weight: 300;
  68. }
  69. .login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
  70. background: none repeat scroll 0 0 #fbfbfb;
  71. }
  72. .login .form .input, .login input[type="text"] {
  73. font-size: 24px;
  74. margin: 2px 6px 16px 0;
  75. padding: 3px;
  76. width: 100%;
  77. }
  78. .login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
  79. background: none repeat scroll 0 0 #fbfbfb;
  80. }
  81. .login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
  82. background: none repeat scroll 0 0 #fbfbfb;
  83. }
  84. .login .form .input, .login input[type="text"] {
  85. font-size: 24px;
  86. margin: 2px 6px 16px 0;
  87. padding: 3px;
  88. width: 100%;
  89. }
  90. .login .form .input, .login input[type="text"] {
  91. font-size: 24px;
  92. margin: 2px 6px 16px 0;
  93. padding: 3px;
  94. width: 100%;
  95. }
  96. input[type="password"], input[type="text"] {
  97. background-color: #fff;
  98. border: 1px solid #ddd;
  99. box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
  100. color: #333;
  101. outline: 0 none;
  102. transition: border-color 0.05s ease-in-out 0s;
  103. }
  104. input[type="password"]:focus, input[type="text"]:focus {
  105. border-color: #5b9dd9;
  106. box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
  107. }
  108. .login .form .forgetmenot {
  109. float: left;
  110. font-weight: 400;
  111. margin-bottom: 0;
  112. }
  113. .login .form .forgetmenot label {
  114. font-size: 12px;
  115. line-height: 19px;
  116. }
  117. #login .form p.submit {
  118. margin: 0;
  119. padding: 0;
  120. }
  121. #loginform p.submit, .login-action-lostpassword p.submit {
  122. border: medium none;
  123. margin: -10px 0 20px;
  124. }
  125. p.submit {
  126. margin-top: 20px;
  127. max-width: 100%;
  128. padding-top: 10px;
  129. text-align: left;
  130. }
  131. .button.button-large {
  132. background: none repeat scroll 0 0 #2ea2cc;
  133. border: 1px solid;
  134. border-radius: 3px;
  135. box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
  136. color: #fff;
  137. float: right;
  138. height: 30px;
  139. line-height: 28px;
  140. padding: 0 12px 2px;
  141. text-decoration: none;
  142. vertical-align: baseline;
  143. }
  144. .button-primary:focus, .button-primary:hover {
  145. background:#1e8cbe;
  146. border-color:#0074a2;
  147. -webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
  148. box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
  149. color:#fff
  150. }
  151. </style>
  152. <body class="login">
  153. <div id="login">
  154. <h1><{$web_cfg.name}></h1>
  155. <div id="login_error"><strong>错误</strong>:键入的用户名或者密码不正确。<br></div>
  156. <div class="form" id="loginform" style="position: static; left: 0px;">
  157. <p>
  158. <label for="user_login">用户名<br>
  159. <input name="name" type="text" size="20" class="input" id="user_login"></label>
  160. </p>
  161. <p>
  162. <label for="user_pass">密码<br>
  163. <input name="pwd" type="password" size="20" class="input" id="user_pass"></label>
  164. </p>
  165. <p class="forgetmenot">
  166. <label for="rememberme">
  167. <input type="checkbox" value="forever" id="rememberme" name="rememberme" checked> 记住我的登录信息
  168. </label>
  169. </p>
  170. <p class="submit submit_btn">
  171. <input type="submit" value="登录" class="button button-primary button-large" id="wp-submit" name="wp-submit">
  172. </p>
  173. </div>
  174. </div>
  175. <script>
  176. KISSY.use('node, io', function (S, Node, IO) {
  177. var $ = S.all;
  178. $('input').on('keyup', function (ev) {
  179. var keyCode = ev.keyCode;
  180. if (keyCode == 13) {
  181. login();
  182. }
  183. });
  184. $('.submit_btn').on('click', function () {
  185. login();
  186. });
  187. function login() {
  188. var name = $("input[name=name]").val();
  189. var pwd = $("input[name=pwd]").val();
  190. new IO({
  191. type: "post"
  192. , url: '<{$web_cfg.domain}>/?c=Admin_BackUser&a=Login'
  193. , data: {'username':name,'password':pwd}
  194. , success: function (data) {
  195. if (data.ok) { //ok
  196. var url = data.msg;
  197. location.href = '<{$web_cfg.domain}>/?c=Admin_Index';
  198. } else {
  199. $(".welcome").hide();
  200. $("#login_error").show();
  201. }
  202. return false;
  203. }
  204. , error: function (NULL, textStatus) {
  205. alert("请求服务器失败,原因:"+textStatus);
  206. }
  207. , dataType: "json"
  208. });
  209. }
  210. function showError($msg) {
  211. $('.alert-danger').html($msg).show();
  212. }
  213. });
  214. </script>
  215. </body>
  216. </html>