login.blade.php 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. @include('admin.uc.head')
  5. </head>
  6. <body class="signin">
  7. <section>
  8. <div class="signinpanel">
  9. <div class="row">
  10. <div class="col-md-3"></div>
  11. <div class="col-md-6">
  12. <!-- 登入表單段 -->
  13. <form id="loginForm" method="post" action="login">
  14. @csrf
  15. <h4 class="nomargin">{{ config('app.name') }}</h4>
  16. <input id="qusername" name="email" placeholder="Username" class="form-control uname" maxlength="100" type="text" />
  17. <label class="error" for="email"></label>
  18. <input id="qpassword" name="password" placeholder="Password" class="form-control pword" maxlength="20" type="password" />
  19. <label class="error" for="password"></label>
  20. <input id="btnSignIn" name="btnSignIn" value="Login" class="btn btn-block btn-success" type="submit" onclick="submitForm();" />
  21. </form>
  22. </div>
  23. <div class="col-md-3"></div>
  24. <!-- col-sm-5 -->
  25. </div>
  26. <!-- row -->
  27. <div class="signup-footer">
  28. <div class="pull-left">
  29. <?php echo env('COPY_RIGHT')?>
  30. </div>
  31. <div class="pull-right">
  32. <?php echo env('CREATOR')?>
  33. </div>
  34. </div>
  35. </div>
  36. <!-- signin -->
  37. </section>
  38. @include('admin.uc.foot')
  39. <!-- 表單JS -->
  40. <script>
  41. //逐個偵錯
  42. $(function () {
  43. //初始化需要偵錯的表格
  44. $('#loginForm').validate();
  45. //正規表達驗證初始化
  46. $.validator.addMethod(
  47. "regex",
  48. function (value, element, regexp) {
  49. var re = new RegExp(regexp);
  50. return this.optional(element) || re.test(value);
  51. }
  52. );
  53. //各欄位
  54. $('#qusername').rules("add", {
  55. required: true,
  56. email: true,
  57. minlength: 1,
  58. maxlength: 100,
  59. messages: {
  60. required: "Username length must between 1-100",
  61. email: "Username must be an email address",
  62. minlength: "Username length must between 1-100",
  63. maxlength: "Username length must between 1-100"
  64. }
  65. });
  66. $('#qpassword').rules("add", {
  67. required: true,
  68. minlength: 1,
  69. maxlength: 20,
  70. messages: {
  71. required: "Password length must between 1-20",
  72. minlength: "Password length must between 1-20",
  73. maxlength: "Password length must between 1-20"
  74. }
  75. });
  76. });
  77. //提交與取消按鈕
  78. function submitForm() {
  79. if (!!($("#loginForm").valid()) === false) {
  80. return false;
  81. } else {
  82. $(document).ready(function() {
  83. $.blockUI({ css: {
  84. border: 'none',
  85. padding: '15px',
  86. backgroundColor: '#000',
  87. '-webkit-border-radius': '10px',
  88. '-moz-border-radius': '10px',
  89. opacity: .5,
  90. color: '#fff'
  91. }});
  92. });
  93. }
  94. }
  95. function cancelValidate() {
  96. $("#loginForm").validate().cancelSubmit = true;
  97. }
  98. </script>
  99. </body>
  100. </html>