Guest User

Untitled

a guest
Apr 20th, 2018
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. <template>
  2. <v-app id="inspire">
  3. <v-content>
  4. <v-container fluid fill-height>
  5. <v-layout align-center justify-center>
  6. <v-flex xs12 sm8 md4>
  7. <v-card class="elevation-12">
  8. <v-toolbar dark color="primary">
  9. ...
  10. </v-toolbar>
  11. <v-card-text>
  12. ...
  13. </v-card-text>
  14. <v-card-actions>
  15. <v-spacer></v-spacer>
  16. <v-btn color="primary" @click='logar()'>Entrar</v-btn>
  17. </v-card-actions>
  18. </v-card>
  19. </v-flex>
  20. </v-layout>
  21. </v-container>
  22. </v-content>
  23. </v-app>
  24. </template>
  25. <script>
  26. export default {
  27. name: 'Login',
  28. data: () => ({
  29. drawer: null,
  30. checkbox: false,
  31. username: 'cartorio@teste.com.br',
  32. password: '1234',
  33. }),
  34. props: {
  35. source: String,
  36. },
  37. methods: {
  38. logar() {
  39. var myVue = this.$vuetify;
  40. this.axios.post('http://localhost:8585/login', {
  41. email: this.username,
  42. senha: this.password,
  43. },
  44. {
  45. withCredentials: false,
  46. headers: {
  47. Accept: 'application/json',
  48. 'Content-Type': 'application/json',
  49. },
  50. },
  51. ).then((response) => {
  52. //HERE I NEED TO USE myVue
  53. window.AUT = response.headers.authorization;
  54. }).catch((error) => {
  55. console.log(error);
  56. });
  57. },
  58. },
  59. };
  60. </script>
Add Comment
Please, Sign In to add comment