Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

loginPage.vue 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. <template>
  2. <div class="container">
  3. <!-- eslint-disable max-len -->
  4. <div class="login-page">
  5. <form id="signIn">
  6. <div class="form col-md-12">
  7. <div>
  8. <h4>Login</h4>
  9. </div>
  10. <button
  11. @click="routerGoTo('/user/register')"
  12. class="btn"
  13. style="margin:2px; color: #60CBEB"
  14. >Register</button>
  15. <button
  16. @click="routerGoTo('/user/registeragency')"
  17. class="btn"
  18. style="margin:2px; color: #60CBEB"
  19. >Agency Registration</button>
  20. <div v-if="this.$store.state.authentication.status === 'error'">
  21. <alert
  22. :text="'User doesn\'t exist or Username and Password is incorrect'"
  23. :type="'ERROR'"
  24. />
  25. </div>
  26. <div class="row">
  27. <div class="col-md-12" style="margin-bottom: 1em">
  28. <div class="input-group mb-3">
  29. <div class="input-group-prepend">
  30. <span class="input-group-text">
  31. <eva-icon name="person-outline" fill="#60CBEB"></eva-icon>
  32. </span>
  33. <input
  34. class="form-control"
  35. type="text"
  36. name="username"
  37. placeholder="Username"
  38. v-model="username"
  39. value
  40. />
  41. </div>
  42. </div>
  43. <div class="input-group mb-3">
  44. <div class="input-group-prepend">
  45. <span class="input-group-text">
  46. <eva-icon name="lock-outline" fill="#60CBEB"></eva-icon>
  47. </span>
  48. <input
  49. class="form-control"
  50. :type="isPasswordShown"
  51. v-model="password"
  52. id="password"
  53. placeholder="Password"
  54. name="password"
  55. value
  56. />
  57. <div class="input-group-append">
  58. <span class="input-group-text">
  59. <eva-icon
  60. v-if="!showPassword"
  61. name="eye-off-outline"
  62. fill="#60CBEB"
  63. @click="togglePassword()"
  64. ></eva-icon>
  65. <eva-icon v-else name="eye-outline" fill="#60CBEB" @click="passwordToggled()"></eva-icon>
  66. </span>
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <button @click="Login()" class="btn btn-b-n" type="submit">Sign In</button>
  73. <hr />
  74. <h5>Trouble signing in?</h5>
  75. <div>
  76. <!-- <alert :text="'Username & password request email sent'" :type="'SUCCESS'" /> -->
  77. <div class="row">
  78. <div class="input-group-prepend">
  79. <span class="input-group-text">
  80. <eva-icon name="email-outline" fill="#60CBEB"></eva-icon>
  81. </span>
  82. <input class="form-control" placeholder="Your Email" type="text" name="email" value />
  83. </div>
  84. </div>
  85. </div>
  86. <div class="form-group row"></div>
  87. <button @click="SendMail()" class="btn btn-b-n" type="submit">Submit</button>
  88. </div>
  89. </form>
  90. </div>
  91. </div>
  92. </template>
  93. <script>
  94. import { mapActions, mapState } from 'vuex';
  95. import alert from '../shared/alert.vue';
  96. export default {
  97. name: 'Login',
  98. components: {
  99. alert,
  100. },
  101. data() {
  102. return {
  103. isPasswordShown: 'password',
  104. selectItems: [{ text: 'password', value: 0 }],
  105. selectErrors: 'Some error with the field',
  106. select: null,
  107. textErrors: 'Some error with the field',
  108. text: '',
  109. showPassword: false,
  110. email: '',
  111. };
  112. },
  113. computed: {
  114. ...mapState('authentication', ['token', 'status', 'username', 'password']),
  115. },
  116. methods: {
  117. ...mapActions('authentication', ['login', 'init']),
  118. Login() {
  119. this.login().then(() => {
  120. if (this.$store.state.authentication.status === 'error') {
  121. this.$router.push('/user/login');
  122. }
  123. });
  124. },
  125. togglePassword() {
  126. this.showPassword = true;
  127. this.isPasswordShown = 'text';
  128. },
  129. passwordToggled() {
  130. this.showPassword = false;
  131. this.isPasswordShown = 'password';
  132. },
  133. SendMail() {},
  134. routerGoTo(goTo) {
  135. console.log(goTo);
  136. this.$router.push(goTo);
  137. },
  138. },
  139. };
  140. </script>
  141. <style>
  142. .goDown {
  143. margin-top: 150px;
  144. }
  145. </style>