index.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
  6. <title>单仓管理系统</title>
  7. <script type="text/javascript" src="/js/jquery.js"></script>
  8. <script type="text/javascript" src="/js/cloud.js"></script>
  9. <script type="text/javascript" src="/src/lib/jquery.cookie.js"></script>
  10. <script type="text/javascript" src="/src/sub/firstVerify.js"></script>
  11. <script type="text/javascript" src="/src/base.js"></script>
  12. <script type="text/javascript" src="/src/config.js"></script>
  13. <!--<script type="text/javascript">
  14. firstVerifyData.init();
  15. </script>-->
  16. <script language="javascript">
  17. var ip = '';
  18. var url =
  19. {
  20. check: ip + '/sys/checkstate',
  21. login: ip + '/sys/login',
  22. mainPage: '/index2.html'
  23. };
  24. // $.ajaxSetup({
  25. // xhrFields: {withCredentials: true }
  26. // });
  27. // $.getJSON(url.check,function(data)
  28. // {
  29. // if(data.code == 0)
  30. // {
  31. // //go to main page
  32. // location.href=url.mainPage;
  33. // }
  34. // });
  35. $(function () {
  36. if ($.cookie("rmbUser") == "true") {
  37. $("#ck_rmbUser").attr("checked", true);
  38. $("#txt_username").val($.cookie("username"));
  39. $("#txt_password").val($.cookie("password"));
  40. }
  41. $.ajaxSetup({xhrFields: {withCredentials: true}});
  42. $('.loginbox').css({'position': 'absolute', 'left': ($(window).width() - 692) / 2});
  43. $(window).resize(function () {
  44. $('.loginbox').css({'position': 'absolute', 'left': ($(window).width() - 692) / 2});
  45. });
  46. $(document).on('keydown', function (e) {
  47. if (event.keyCode == 13) {
  48. $('.loginbtn').trigger('click');
  49. }
  50. })
  51. $(document).on('click', '.loginbtn', function (e) {
  52. e.preventDefault();
  53. if ($("#ck_rmbUser").attr("checked")) {
  54. var str_username = $("#txt_username").val();
  55. var str_password = $("#txt_password").val();
  56. $.cookie("rmbUser", "true", {expires: 7}); //存储一个带7天期限的cookie
  57. $.cookie("username", str_username, {expires: 7});
  58. $.cookie("password", str_password, {expires: 7});
  59. } else {
  60. $.cookie("rmbUser", "false", {expire: -1});
  61. $.cookie("username", "", {expires: -1});
  62. $.cookie("password", "", {expires: -1});
  63. }
  64. var username = $('.loginuser').val();
  65. var password = $('.loginpwd').val();
  66. if (username && password) {
  67. var data = {
  68. name: username,
  69. password: password
  70. };
  71. $.post(url.login, data, function (data) {
  72. if (data.code == 0) {
  73. // console.log(data.defaultHome);
  74. // function getCookie(c_name) {
  75. // if (document.cookie.length > 0) {
  76. // c_start = document.cookie.indexOf(c_name + "=")
  77. // if (c_start != -1) {
  78. // c_start = c_start + c_name.length + 1
  79. // c_end = document.cookie.indexOf(";", c_start)
  80. // if (c_end == -1) c_end = document.cookie.length
  81. // return unescape(document.cookie.substring(c_start, c_end))
  82. // } else {
  83. // return false;
  84. // }
  85. // }
  86. // return false;
  87. // }
  88. function setCookie(name, value) {
  89. var Days = 30;
  90. var exp = new Date();
  91. exp.setTime(exp.getTime() + Days * 24 * 60 * 60 * 1000);
  92. document.cookie = name + "=" + escape(value) + ";expires=" + exp.toGMTString() + ";path=/";
  93. }
  94. setCookie('status', 'yes');
  95. location.href = data.defaultHome;
  96. } else {
  97. alert(data.msg);
  98. }
  99. }, 'json');
  100. } else {
  101. alert('请填写用户名和密码');
  102. }
  103. });
  104. });
  105. </script>
  106. <style>
  107. * {
  108. font-size: 9pt;
  109. border: 0;
  110. margin: 0;
  111. padding: 0;
  112. }
  113. body {
  114. font-family: '微软雅黑';
  115. margin: 0 auto;
  116. min-width: 980px;
  117. background-color: #1c77ac;
  118. background-image: url(/img/light.png);
  119. background-repeat: no-repeat;
  120. background-position: center top;
  121. overflow: hidden;
  122. }
  123. ul {
  124. display: block;
  125. margin: 0;
  126. padding: 0;
  127. list-style: none;
  128. }
  129. li {
  130. display: block;
  131. margin: 0;
  132. padding: 0;
  133. list-style: none;
  134. }
  135. img {
  136. border: 0;
  137. }
  138. dl, dt, dd, span {
  139. margin: 0;
  140. padding: 0;
  141. display: block;
  142. }
  143. a, a:focus {
  144. text-decoration: none;
  145. color: #000;
  146. outline: none;
  147. blr: expression(this.onFocus=this.blur());
  148. }
  149. a:hover {
  150. color: #00a4ac;
  151. text-decoration: none;
  152. }
  153. table {
  154. border-collapse: collapse;
  155. border-spacing: 0;
  156. }
  157. cite {
  158. font-style: normal;
  159. }
  160. h2 {
  161. font-weight: normal;
  162. }
  163. /*cloud*/
  164. #mainBody {
  165. width: 100%;
  166. height: 100%;
  167. position: absolute;
  168. z-index: -1;
  169. }
  170. .cloud {
  171. position: absolute;
  172. top: 0px;
  173. left: 0px;
  174. width: 100%;
  175. height: 100%;
  176. background: url(/img/cloud.png) no-repeat;
  177. z-index: 1;
  178. opacity: 0.5;
  179. }
  180. #cloud2 {
  181. z-index: 2;
  182. }
  183. /*login*/
  184. .logintop {
  185. height: 47px;
  186. position: absolute;
  187. top: 0;
  188. background: url(/img/loginbg1.png) repeat-x;
  189. z-index: 100;
  190. width: 100%;
  191. }
  192. .logintop span {
  193. color: #fff;
  194. line-height: 47px;
  195. background: url(/img/loginsj.png) no-repeat 21px 18px;
  196. text-indent: 44px;
  197. color: #afc5d2;
  198. float: left;
  199. }
  200. .logintop ul {
  201. float: right;
  202. padding-right: 30px;
  203. }
  204. .logintop ul li {
  205. float: left;
  206. margin-left: 20px;
  207. line-height: 47px;
  208. }
  209. .logintop ul li a {
  210. color: #afc5d2;
  211. }
  212. .logintop ul li a:hover {
  213. color: #fff;
  214. }
  215. .loginbody {
  216. background: url(/img/loginbg3.png) no-repeat center center;
  217. width: 100%;
  218. height: 585px;
  219. overflow: hidden;
  220. position: absolute;
  221. top: 47px;
  222. }
  223. .systemlogo {
  224. background: url(/img/loginlogo.png) no-repeat center;
  225. width: 100%;
  226. height: 86px;
  227. margin-top: 60px;
  228. }
  229. .loginbox {
  230. width: 692px;
  231. margin-left: -6%;
  232. height: 336px;
  233. background: url(/img/logininfo.png) no-repeat;
  234. margin-top: 30px;
  235. }
  236. .loginbox ul {
  237. margin-top: 88px;
  238. margin-left: 451px;
  239. }
  240. .loginbox ul li {
  241. margin-bottom: 25px;
  242. }
  243. .loginbox ul li label {
  244. color: #687f92;
  245. padding-left: 25px;
  246. }
  247. .loginbox ul li label a {
  248. color: #687f92;
  249. }
  250. .loginbox ul li label a:hover {
  251. color: #3d96c9;
  252. }
  253. .loginbox ul li label input {
  254. margin-right: 5px;
  255. }
  256. .loginuser {
  257. width: 299px;
  258. height: 48px;
  259. background: url(/img/loginuser.png) no-repeat;
  260. border: none;
  261. line-height: 48px;
  262. padding-left: 44px;
  263. font-size: 14px;
  264. font-weight: bold;
  265. }
  266. .loginpwd {
  267. width: 299px;
  268. height: 48px;
  269. background: url(/img/loginpassword.png) no-repeat;
  270. border: none;
  271. line-height: 48px;
  272. padding-left: 44px;
  273. font-size: 14px;
  274. color: #90a2bc;
  275. }
  276. .loginbtn {
  277. width: 111px;
  278. height: 35px;
  279. background: url(/img/buttonbg.png) repeat-x;
  280. font-size: 14px;
  281. font-weight: bold;
  282. color: #fff;
  283. cursor: pointer;
  284. line-height: 35px;
  285. }
  286. .loginbm {
  287. height: 50px;
  288. line-height: 50px;
  289. text-align: center;
  290. background: url(/img/loginbg2.png) repeat-x;
  291. position: absolute;
  292. bottom: 0;
  293. width: 100%;
  294. color: #0b3a58;
  295. }
  296. .loginbm a {
  297. font-weight: bold;
  298. color: #0b3a58;
  299. }
  300. .loginbm a:hover {
  301. color: #fff;
  302. }
  303. </style>
  304. </head>
  305. <body>
  306. <div id="mainBody">
  307. <div id="cloud1" class="cloud"></div>
  308. <div id="cloud2" class="cloud"></div>
  309. </div>
  310. <div class="logintop">
  311. <span>欢迎登录后台管理界面平台</span>
  312. <ul>
  313. <li><a href="#">回首页</a></li>
  314. <li><a href="#">帮助</a></li>
  315. <li><a href="#">关于</a></li>
  316. </ul>
  317. </div>
  318. <div class="loginbody">
  319. <span class="systemlogo"></span>
  320. <div class="loginbox" style="width:1000px;left:20%;">
  321. <ul>
  322. <form action="/admin/sys/login" method="post">
  323. <li><input name="loginName" id="txt_username" type="text" class="loginuser" value=""/></li>
  324. <li><input name="loginPwd" id="txt_password" type="password" class="loginpwd"/></li>
  325. <li><input name="sub" type="button" class="loginbtn" value="登录"/>
  326. <label><input id="ck_rmbUser" type="checkbox" value="" checked="checked"/>记住密码</label>
  327. </li>
  328. </form>
  329. </ul>
  330. </div>
  331. </div>
  332. <div class="loginbm">版权所有 <span id="footbottom" style="display:inline-block"></span> <a
  333. href="javascript:void(0)">单仓管理系统</a></div>
  334. </body>
  335. <script>
  336. $.ajax({
  337. type: "get",
  338. dataType: 'json',
  339. contentType: 'application/json;charset=utf-8',
  340. url: config.baseUrl + '/sys/sync/serverTime',
  341. success: function (e) {
  342. $('#footbottom').text(e.data)
  343. },
  344. error: function (e) {
  345. console.log(e);
  346. }
  347. });
  348. </script>
  349. </html>