您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

loginPage.vue 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <template>
  2. <div class="container">
  3. <!-- eslint-disable max-len -->
  4. <div class="login-page">
  5. <form id="signIn">
  6. <div class="form">
  7. <div>
  8. <h4>Login</h4>
  9. </div>
  10. <div class="row">
  11. <div class="col-md-11" style="margin-bottom: 1em">
  12. <div class="input-group mb-3">
  13. <div class="input-group-prepend">
  14. <span class="input-group-text">
  15. <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
  16. </span>
  17. <input
  18. class="form-control"
  19. type="text"
  20. name="username"
  21. placeholder="Username"
  22. value
  23. />
  24. </div>
  25. </div>
  26. <div class="input-group mb-3">
  27. <div class="input-group-prepend">
  28. <span class="input-group-text">
  29. <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
  30. </span>
  31. <input
  32. class="form-control"
  33. :type="isPasswordShown"
  34. v-model="password"
  35. id="password"
  36. placeholder="Password"
  37. name="password"
  38. value
  39. />
  40. <div class="input-group-append">
  41. <span class="input-group-text">
  42. <eva-icon
  43. v-if="!showPassword"
  44. name="eye-off-outline"
  45. fill="#60CBEB"
  46. @click="togglePassword()"
  47. ></eva-icon>
  48. <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="passwordToggled()"></eva-icon>
  49. </span>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <div class="form-group row"></div>
  56. <button @click="Login()" class="btn btn-b-n" type="submit">Sign In</button>
  57. <p v-if="user !== null">{{ user }}</p>
  58. </div>
  59. </form>
  60. <form id="forgot">
  61. <div class="form">
  62. <h5>Trouble signing in?</h5>
  63. <div>
  64. <div class="row">
  65. <div class="input-group-prepend">
  66. <span class="input-group-text">
  67. <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
  68. </span>
  69. <input class="form-control" placeholder="Your Email" type="text" name="email" value />
  70. </div>
  71. </div>
  72. </div>
  73. <div class="form-group row"></div>
  74. <div class="offset-md-3 col-md-5">
  75. <button @click="SendMail()" class="btn btn-b-n" type="submit">Get Help</button>
  76. </div>
  77. </div>
  78. </form>
  79. </div>
  80. </div>
  81. </template>
  82. <script>
  83. const axios = require('axios');
  84. export default {
  85. name: 'Login',
  86. data() {
  87. return {
  88. username: '',
  89. user: null,
  90. isPasswordShown: 'password',
  91. selectItems: [{ text: 'password', value: 0 }],
  92. selectErrors: 'Some error with the field',
  93. select: null,
  94. textErrors: 'Some error with the field',
  95. text: '',
  96. showPassword: false,
  97. password: '',
  98. };
  99. },
  100. methods: {
  101. Login() {
  102. axios
  103. .post('/api/register/authenticate', {
  104. username: this.username,
  105. password: this.password,
  106. })
  107. .then(response => console.log(response.data))
  108. .catch(error => console.log(error.push));
  109. this.$router.push('/');
  110. },
  111. togglePassword() {
  112. this.showPassword = true;
  113. this.isPasswordShown = 'text';
  114. },
  115. passwordToggled() {
  116. this.showPassword = false;
  117. this.isPasswordShown = 'password';
  118. },
  119. SendMail() {},
  120. },
  121. };
  122. </script>
  123. <style>
  124. .goDown {
  125. margin-top: 150px;
  126. }
  127. </style>