iblogin.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. \yii\web\YiiAsset::register($this);
  3. ?>
  4. <?php $this->beginPage() ?>
  5. <!DOCTYPE html>
  6. <html lang="<?= Yii::$app->language ?>">
  7. <head>
  8. <meta charset="<?= Yii::$app->charset ?>">
  9. <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge">
  10. <?= \yii\helpers\Html::csrfMetaTags() ?>
  11. <title>欢迎使用X Broker</title>
  12. <?php $this->head() ?>
  13. <link href="<?= STATIC_URL ?>/ui/css/bootstrap.min.css" rel="stylesheet">
  14. <link href="<?= STATIC_URL ?>/ui/font-awesome/css/font-awesome.css" rel="stylesheet">
  15. <link href="<?= STATIC_URL ?>/ui/css/animate.css" rel="stylesheet">
  16. <link href="<?= STATIC_URL ?>/ui/css/style.css" rel="stylesheet">
  17. <link href="<?= STATIC_URL ?>/ui/css/plugins/toastr/toastr.min.css" rel="stylesheet">
  18. </head>
  19. <body class="gray-bg">
  20. <?php $this->beginBody() ?>
  21. <div class="loginColumns animated fadeInDown">
  22. <div class="row">
  23. <div class="col-md-3"></div>
  24. <div class="col-md-6">
  25. <h1 class="text-center">X Broker</h1>
  26. <hr/>
  27. </div>
  28. <div class="col-md-3"></div>
  29. </div>
  30. <div class="row">
  31. <div class="col-md-3"></div>
  32. <div class="col-md-6">
  33. <div class="ibox-title">
  34. 欢迎使用X Broker
  35. </div>
  36. <div class="ibox-content">
  37. <form id="form" class="m-t" role="form">
  38. <div class="input-group" style="margin-bottom:15px;">
  39. <span class="input-group-btn">
  40. <button type="button" class="btn btn-default">户名</button>
  41. </span>
  42. <input type="text" id="username" name="username" class="form-control" placeholder="您的电子邮箱或用户名" required="">
  43. </div>
  44. <div class="input-group" style="margin-bottom:15px;">
  45. <span class="input-group-btn">
  46. <button type="button" class="btn btn-default">密码</button>
  47. </span>
  48. <input type="password" id="password" name="password" class="form-control" placeholder="您的登录密码" required="">
  49. </div>
  50. <button id="login" type="button" class="btn btn-primary block full-width m-b">登录</button>
  51. <a href="<?= \yii\helpers\Url::to(['pwd?type=2']) ?>">
  52. <small>忘记密码?</small>
  53. </a>
  54. <a href="<?= \yii\helpers\Url::to(['open']) ?>" class="pull-right">
  55. <small>没有账户?</small>
  56. </a>
  57. </form>
  58. </div>
  59. <hr/>
  60. </div>
  61. <div class="col-md-3"></div>
  62. </div>
  63. <div class="row">
  64. <div class="col-md-3"></div>
  65. <div class="col-md-6 text-right">
  66. <small>©2016-2019 Vegard</small>
  67. </div>
  68. <div class="col-md-3"></div>
  69. </div>
  70. </div>
  71. <?php $this->endBody() ?>
  72. <script src="<?= STATIC_URL ?>/ui/js/jquery.1.9.1.min.js"></script>
  73. <script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
  74. <script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
  75. <script type="text/javascript">
  76. $("#login").on("click",function(){
  77. $.ajax({
  78. type: "POST",
  79. url: "<?= \yii\helpers\Url::to(['iblogin-post']) ?>",
  80. data: $('#form').serialize(),
  81. dataType: "json",
  82. beforeSend: function() {},
  83. success: function(data) {
  84. if(data.isSuccess){
  85. var url="<?= \yii\helpers\Url::to(['/ib/dashboard']) ?>";
  86. window.location.href=url;
  87. }else{
  88. toastr.error("用户名或密码错误", "提示");
  89. }
  90. },
  91. complete: function(XMLHttpRequest, textStatus) {},
  92. error: function() {}
  93. });
  94. });
  95. </script>
  96. </body>
  97. </html>