-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
153 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<template> | ||
<v-container grid-list-xl text-xs-center> | ||
<v-layout row wrap> | ||
<v-flex xs10 offset-xs1> | ||
<v-card> | ||
<v-card-title> | ||
<h1>Registrando novo usuário</h1> | ||
</v-card-title> | ||
<v-card-text> | ||
<v-form ref="form" v-model="valid" lazy-validation autocomplete="off"> | ||
<v-text-field v-model="user.email" :rules="emailRules" id="email" label="E-mail" prepend-icon="email" type="texst" | ||
required></v-text-field> | ||
<v-text-field v-model="user.password" :rules="passwordRules" id="password" label="Senha" prepend-icon="lock" | ||
type="password" required></v-text-field> | ||
<v-text-field v-model="repassword" :rules="repasswordRules" id="repassword" label="Confirma a senha" prepend-icon="lock" | ||
type="password" required></v-text-field> | ||
<div class="text-xs-center"> | ||
<v-btn color="info" :large="true" to="/">Voltar</v-btn> | ||
<v-btn color="success" :large="true" :disabled="!valid" @click="submit">SALVAR</v-btn> | ||
</div> | ||
</v-form> | ||
</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
</v-layout> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
/* eslint-disable no-console */ | ||
export default { | ||
data: () => ({ | ||
}), | ||
methods: { | ||
async submit() { | ||
try { | ||
await this.$store.dispatch('REGISTER', this.user) | ||
this.$router.push({path: '/confirmation'}) | ||
} catch (err) { | ||
//TODO EXIBIR MENSAGEM DE ERRO NA TELA ATRAVES DE UM TOAST OU ALGO DO TIPO | ||
console.log(err) | ||
} | ||
} | ||
} | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,64 @@ | ||
<template> | ||
<div> | ||
<h1>Tela para Geração dos Tokens</h1> | ||
</div> | ||
<v-container grid-list-xl text-xs-center> | ||
<v-layout row wrap> | ||
<v-flex xs10 offset-xs1> | ||
<v-card> | ||
<v-card-title> | ||
<h1>Gerar token</h1> | ||
</v-card-title> | ||
<v-card-text> | ||
<div class="text-xs-center"> | ||
<v-btn @click="generateAccessToken()"> | ||
Clique para gerar | ||
<v-icon>settings</v-icon> | ||
</v-btn> | ||
</div> | ||
<p> | ||
Token: {{accessToken.token}} <br> | ||
Data expiração: {{accessToken.expirationDate}} | ||
</p> | ||
</v-card-text> | ||
</v-card> | ||
</v-flex> | ||
</v-layout> | ||
</v-container> | ||
</template> | ||
|
||
<script> | ||
import moment from 'moment' | ||
export default { | ||
data () { | ||
return { | ||
accessToken: { | ||
token: '', | ||
createAt: '', | ||
expirationDate: '', | ||
user_email: '' | ||
} | ||
} | ||
}, | ||
methods:{ | ||
generateAccessToken (){ | ||
var user_email = this.$store.state.user_logged | ||
var number_1 = Math.floor((Math.random() * 10) + 1) | ||
var number_2 = Math.floor((Math.random() * 10) + 1) | ||
var number_3 = Math.floor((Math.random() * 10) + 1) | ||
var charsAcessToken = ""; | ||
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | ||
for (var i = 0; i < 3; i++){ | ||
charsAcessToken += possible.charAt(Math.floor(Math.random() * possible.length)); | ||
} | ||
this.accessToken.token = charsAcessToken + number_1 + number_2 + number_3 | ||
this.accessToken.createAt = moment().subtract(10, 'days').calendar() | ||
// this.accessToken.expirationDate = this.accessToken.createAt.add(7, 'days') | ||
var expiration = moment().add(7, 'd') | ||
this.accessToken.expirationDate = expiration._d | ||
// console.log(this.accessToken) | ||
} | ||
} | ||
} | ||
</script> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters