Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <template>
- <v-app id="inspire">
- <v-content>
- <v-container fluid fill-height>
- <v-layout align-center justify-center>
- <v-flex xs12 sm8 md4>
- <v-card class="elevation-12">
- <v-toolbar dark color="primary">
- ...
- </v-toolbar>
- <v-card-text>
- ...
- </v-card-text>
- <v-card-actions>
- <v-spacer></v-spacer>
- <v-btn color="primary" @click='logar()'>Entrar</v-btn>
- </v-card-actions>
- </v-card>
- </v-flex>
- </v-layout>
- </v-container>
- </v-content>
- </v-app>
- </template>
- <script>
- export default {
- name: 'Login',
- data: () => ({
- drawer: null,
- checkbox: false,
- username: 'cartorio@teste.com.br',
- password: '1234',
- }),
- props: {
- source: String,
- },
- methods: {
- logar() {
- var myVue = this.$vuetify;
- this.axios.post('http://localhost:8585/login', {
- email: this.username,
- senha: this.password,
- },
- {
- withCredentials: false,
- headers: {
- Accept: 'application/json',
- 'Content-Type': 'application/json',
- },
- },
- ).then((response) => {
- //HERE I NEED TO USE myVue
- window.AUT = response.headers.authorization;
- }).catch((error) => {
- console.log(error);
- });
- },
- },
- };
- </script>
Add Comment
Please, Sign In to add comment