login si está verificado
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<template>
|
||||
<div class="bg-light-green window-height window-width row justify-center items-center">
|
||||
<div
|
||||
class="bg-light-green window-height window-width row justify-center items-center"
|
||||
>
|
||||
<div class="column">
|
||||
<div class="row">
|
||||
<h5 class="text-h5 text-white q-my-md">Mis listas</h5>
|
||||
@@ -8,39 +10,88 @@
|
||||
<q-card square bordered class="q-pa-lg shadow-1">
|
||||
<q-card-section>
|
||||
<q-form class="q-gutter-md" @click.once="recibeDatos()">
|
||||
<q-input square filled clearable v-model="username" type="text" label="username" :rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 3) || 'Mínimo 3 caracteres',
|
||||
(val) => comprobarUsername || 'Ya existe en la BD',
|
||||
(val) => /^[A-Z0-9]+$/i.test(val) || 'Sólo letras o números'
|
||||
]" />
|
||||
<q-input square filled clearable v-model="nombre" type="text" label="nombre completo" :rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 3) || 'Mínimo 3 caracteres',
|
||||
]" />
|
||||
<q-input square filled clearable v-model="email" type="email" label="email" :rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 7) || 'Mínimo 7 caracteres',
|
||||
(val) =>
|
||||
comprobarEmail ||
|
||||
'No es un email válido o ya existe en la BD',
|
||||
]" />
|
||||
<q-input square filled clearable v-model="password" type="password" label="password" :rules="[
|
||||
(val) =>
|
||||
(val != null && val.trim().length >= 8) ||
|
||||
'Mínimo 8 caracteres',
|
||||
]" />
|
||||
<q-input square filled clearable v-model="confirmpassword" type="password" label="repite password"
|
||||
error-message="No coinciden" :error="comprobarConfirmPassword" />
|
||||
<q-input
|
||||
square
|
||||
filled
|
||||
clearable
|
||||
v-model="username"
|
||||
type="text"
|
||||
label="username"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 3) || 'Mínimo 3 caracteres',
|
||||
(val) => comprobarUsername || 'Ya existe en la BD',
|
||||
(val) => /^[A-Z0-9]+$/i.test(val) || 'Sólo letras o números',
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
square
|
||||
filled
|
||||
clearable
|
||||
v-model="nombre"
|
||||
type="text"
|
||||
label="nombre completo"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 3) || 'Mínimo 3 caracteres',
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
square
|
||||
filled
|
||||
clearable
|
||||
v-model="email"
|
||||
type="email"
|
||||
label="email"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val != null && val.length >= 7) || 'Mínimo 7 caracteres',
|
||||
(val) =>
|
||||
comprobarEmail ||
|
||||
'No es un email válido o ya existe en la BD',
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
square
|
||||
filled
|
||||
clearable
|
||||
v-model="password"
|
||||
type="password"
|
||||
label="password"
|
||||
:rules="[
|
||||
(val) =>
|
||||
(val != null && val.trim().length >= 8) ||
|
||||
'Mínimo 8 caracteres',
|
||||
]"
|
||||
/>
|
||||
<q-input
|
||||
square
|
||||
filled
|
||||
clearable
|
||||
v-model="confirmpassword"
|
||||
type="password"
|
||||
label="repite password"
|
||||
error-message="No coinciden"
|
||||
:error="comprobarConfirmPassword"
|
||||
/>
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
<q-card-actions class="q-px-md">
|
||||
<q-btn :disable="btnRegisterDisable()" unelevated color="light-green-7" size="lg" class="full-width"
|
||||
label="Register" @click="registrar()" />
|
||||
<q-btn
|
||||
:disable="btnRegisterDisable()"
|
||||
unelevated
|
||||
color="light-green-7"
|
||||
size="lg"
|
||||
class="full-width"
|
||||
label="Register"
|
||||
@click="registrar()"
|
||||
/>
|
||||
</q-card-actions>
|
||||
<q-card-section class="text-center q-pa-none">
|
||||
<p class="text-grey-6">
|
||||
<router-link to="/login">Are you registered? Go to Login</router-link>
|
||||
<router-link to="/login"
|
||||
>Are you registered? Go to Login</router-link
|
||||
>
|
||||
</p>
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
@@ -112,15 +163,15 @@ const btnRegisterDisable = () => {
|
||||
|
||||
const registrar = () => {
|
||||
const data = {
|
||||
'username': username.value,
|
||||
'email': email.value,
|
||||
'emailVisibility': true,
|
||||
'password': password.value,
|
||||
'passwordConfirm': confirmpassword.value,
|
||||
'name': nombre.value
|
||||
}
|
||||
listaStore.register(data)
|
||||
}
|
||||
username: username.value,
|
||||
email: email.value,
|
||||
emailVisibility: true,
|
||||
password: password.value,
|
||||
passwordConfirm: confirmpassword.value,
|
||||
name: nombre.value,
|
||||
};
|
||||
listaStore.register(data);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
Reference in New Issue
Block a user