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

loginPage.vue 4.1KB

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