11c914259efd0a416824b7fc010eedba.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <?php /*a:2:{s:97:"E:\phpstudy_pro_8.1.0.1_64bit_Green\phpstudy_pro\WWW\yueshengshop\app\admin\view\login\login.html";i:1587546498;s:90:"E:\phpstudy_pro_8.1.0.1_64bit_Green\phpstudy_pro\WWW\yueshengshop\app\admin\view\base.html";i:1587517806;}*/ ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta name="renderer" content="webkit" />
  6. <meta http-equiv="X-UA-COMPATIBLE" content="IE=edge,chrome=1" />
  7. <title><?php echo htmlentities((isset($menu_info['title']) && ($menu_info['title'] !== '')?$menu_info['title']:"")); ?> - <?php echo htmlentities((isset($website['title']) && ($website['title'] !== '')?$website['title']:"Niushop开源商城")); ?></title>
  8. <meta name="keywords" content="<?php echo htmlentities((isset($website['keywords']) && ($website['keywords'] !== '')?$website['keywords']:'Niushop开源商城')); ?>">
  9. <meta name="description" content="<?php echo htmlentities((isset($website['desc']) && ($website['desc'] !== '')?$website['desc']:'描述')); ?>}">
  10. <link rel="icon" type="image/x-icon" href="http://yueshengshop.top/public/static/img/bitbug_favicon.ico" />
  11. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/css/iconfont.css" />
  12. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/ext/layui/css/layui.css" />
  13. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/public/static/loading/msgbox.css"/>
  14. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/app/admin/view/public/css/common.css" />
  15. <script src="http://yueshengshop.top/public/static/js/jquery-3.1.1.js"></script>
  16. <script src="http://yueshengshop.top/public/static/ext/layui/layui.js"></script>
  17. <script>
  18. layui.use(['layer', 'upload', 'element'], function() {});
  19. window.ns_url = {
  20. baseUrl: "http://yueshengshop.top/",
  21. route: ['<?php echo request()->module(); ?>', '<?php echo request()->controller(); ?>', '<?php echo request()->action(); ?>'],
  22. };
  23. </script>
  24. <script src="http://yueshengshop.top/public/static/js/common.js"></script>
  25. <style>
  26. .ns-calendar{background: url("http://yueshengshop.top/public/static/img/ns_calendar.png") no-repeat center / 16px 16px;}
  27. </style>
  28. <link rel="stylesheet" type="text/css" href="http://yueshengshop.top/app/admin/view/public/css/login.css" />
  29. <script type="text/javascript">
  30. </script>
  31. </head>
  32. <body>
  33. <div class="layui-container">
  34. <div class="layui-form login-form">
  35. <div class="ns-login-logo">
  36. <img src="http://yueshengshop.top/app/admin/view/public/img/login/login_logo.png" />
  37. </div>
  38. <div class="layui-form-title">
  39. <h1>多商户后台登录系统</h1>
  40. </div>
  41. <div class="layui-form-item">
  42. <img class="ns-input-icon" src="http://yueshengshop.top/app/admin/view/public/img/login/username.png" />
  43. <input type="text" name="username" lay-verify="userName" placeholder="请输入用户名" autocomplete="off" class="layui-input">
  44. </div>
  45. <div class="layui-form-item">
  46. <img class="ns-input-icon" src="http://yueshengshop.top/app/admin/view/public/img/login/password.png" />
  47. <input type="password" name="password" lay-verify="password" placeholder="请输入密码" autocomplete="off" class="layui-input">
  48. </div>
  49. <?php if($admin_login == 1): ?>
  50. <div class="layui-form-item verify-code-box">
  51. <input type="text" name="captcha" lay-verify="verificationCode" placeholder="请输入验证码" class="layui-input" value="">
  52. <div class="verify-code-img">
  53. <img id='verify_img' src="<?php echo htmlentities($captcha['img']); ?>" alt='captcha' onclick="verificationCode()"/>
  54. </div>
  55. </div>
  56. <input type="hidden" name="captcha_id" value="<?php echo htmlentities($captcha['id']); ?>">
  57. <?php endif; ?>
  58. <div class="layui-form-item ns-login-btn">
  59. <button class="layui-btn layui-btn-fluid ns-bg-color" lay-submit lay-filter="login">登 录</button>
  60. </div>
  61. </div>
  62. <div class="ns-login-bottom">
  63. 版权所有 © 2019-2020 山西牛酷信息科技有限公司,并保留所有权利
  64. </div>
  65. </div>
  66. <script>
  67. layui.use('form', function() {
  68. var form = layui.form,
  69. repeat_flag = false; //防重复标识
  70. /**
  71. * 登录
  72. */
  73. form.on('submit(login)', function(data) {
  74. if (repeat_flag) return false;
  75. repeat_flag = true;
  76. $.ajax({
  77. type: "POST",
  78. url: "<?php echo url('admin/login/login'); ?>",
  79. data: data.field,
  80. dataType: "JSON",
  81. success: function(res) {
  82. if (res.code == 0) {
  83. layer.msg('登录成功',{anim: 5,time: 500},function () {
  84. window.location = "<?php echo url('admin/index/index'); ?>";
  85. })
  86. } else {
  87. layer.msg(res.message);
  88. repeat_flag = false;
  89. verificationCode();
  90. }
  91. }
  92. });
  93. });
  94. $(document).keydown(function(event) {
  95. if (event.keyCode == 13) {
  96. $(".ns-login-btn button").trigger("click");
  97. }
  98. });
  99. /**
  100. * 表单验证
  101. */
  102. form.verify({
  103. userName: function(value) {
  104. if (!value) {
  105. return "用户名不能为空";
  106. }
  107. },
  108. password: function(value) {
  109. if (!value) {
  110. return "密码不能为空";
  111. }
  112. },
  113. verificationCode: function(value) {
  114. if (!value) {
  115. return "验证码不能为空";
  116. }
  117. }
  118. });
  119. });
  120. /**
  121. * 验证码
  122. */
  123. function verificationCode(){
  124. $.ajax({
  125. type: "get",
  126. url: "<?php echo url('admin/login/captcha'); ?>",
  127. dataType: "JSON",
  128. async: false,
  129. success: function (res) {
  130. var data = res.data;
  131. $("#verify_img").attr("src",data.img);
  132. $("input[name='captcha_id']").val(data.id);
  133. }
  134. });
  135. }
  136. </script>
  137. </body>
  138. </html>