doCheck.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>耀荣康健</title>
  6. <script src="./js/jquery-3.2.1.min.js"></script>
  7. <script src="./js/layer.js"></script>
  8. </head>
  9. <body>
  10. <div style="margin: 0 auto; height: 100%; width: 100%; text-align: center">
  11. <div style="height: 150px; color: aliceblue; background-color: blue; line-height: 150px">
  12. <span>header...header...</span>
  13. </div>
  14. <div style="height: 600px">
  15. <iframe id="gameIFrame" width="1000" height="600" frameborder="0" scrolling="false"></iframe>
  16. </div>
  17. <div style="height: 150px; color: aliceblue; background-color: #888888; line-height: 150px">
  18. <span>bottom...bottom...</span>
  19. </div>
  20. </div>
  21. <script>
  22. $(function () {
  23. // alert("aa")
  24. // layer.msg('hello')
  25. // layer.alert('酷毙了', {icon: 1});
  26. // layer.open({
  27. // skin: 'demo-class',
  28. // title: '在线调试',
  29. // content: '配置各种参数,试试效果aa',
  30. // end: function () {
  31. // alert("aa")
  32. // }
  33. // // ,offset:'rb'
  34. // });
  35. layer.alert('cece', {icon: 2}, function () {
  36. layer.closeAll()
  37. });
  38. })
  39. function checkLogin() {
  40. $.ajax({
  41. url: './login/checkLogin',
  42. type: 'POST',
  43. dataType: 'json',
  44. success: function (res) {
  45. // console.log('成功:', res.code);
  46. if (res.code == 0) {
  47. isLogin = true
  48. docheck()
  49. } else {
  50. isLogin = false
  51. LAYER_ID = layer.open({
  52. // icon: 2,
  53. type: 2,
  54. title: ["请先登录", "font-size:18px"],
  55. // title: false,
  56. content: './login.html',
  57. scrollbar: false,
  58. area: ['800px', '500px'],
  59. // offset:'100px',
  60. anim: 0
  61. });
  62. }
  63. },
  64. error: function (xhr, status, error) {
  65. // console.error('错误:', error);
  66. }
  67. });
  68. }
  69. </script>
  70. </body>
  71. </html>