fecha minima nuevo registro y limpiar login
This commit is contained in:
@@ -190,7 +190,7 @@ export default {
|
||||
noCuenta: "",
|
||||
sizeOk: "",
|
||||
searched: false,
|
||||
minDate: new Date("2020-12-20"),
|
||||
minDate: new Date(),
|
||||
programaSelectedID: "",
|
||||
file: [],
|
||||
programas: [],
|
||||
@@ -468,6 +468,10 @@ export default {
|
||||
.catch((error) => {
|
||||
this.error(error.response.data.message);
|
||||
});
|
||||
|
||||
(this.minDate).setDate( (this.minDate).getDate() - 16)
|
||||
|
||||
|
||||
},
|
||||
computed: {
|
||||
minDate2() {
|
||||
|
||||
+8
-14
@@ -12,8 +12,6 @@
|
||||
</b-field>
|
||||
|
||||
<b-field label="Contraseña">
|
||||
<!-- message="This email is invalid"
|
||||
type="is-danger" -->
|
||||
<b-input v-model="password" type="password" password-reveal></b-input>
|
||||
</b-field>
|
||||
|
||||
@@ -28,6 +26,7 @@
|
||||
</b-field>
|
||||
</div>
|
||||
</div>
|
||||
<b-loading :is-full-page="true" v-model="isLoading" :can-cancel="false" />
|
||||
</section>
|
||||
</template>
|
||||
|
||||
@@ -41,36 +40,28 @@ export default {
|
||||
usuario: "",
|
||||
password: "",
|
||||
error: false,
|
||||
isFullPage: true,
|
||||
isLoading: false,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
usuarioValido() {
|
||||
if (!this.usuario) {
|
||||
console.log("esta vacio");
|
||||
// return ''
|
||||
this.error = true;
|
||||
}
|
||||
if (validator.isNumeric(this.usuario, { no_symbols: true })) {
|
||||
if (this.usuario.length === 10) {
|
||||
console.log("es numero de cuenta");
|
||||
}
|
||||
return "";
|
||||
} else if (validator.isEmail(this.usuario)) {
|
||||
console.log("es correo");
|
||||
return "";
|
||||
} else if (validator.isAlpha(this.usuario)) {
|
||||
console.log("es texto");
|
||||
return "";
|
||||
}
|
||||
// return 'is-danger'
|
||||
this.error = true;
|
||||
},
|
||||
|
||||
enviar() {
|
||||
const loadingComponent = this.$buefy.loading.open({
|
||||
container: this.isFullPage ? null : this.$refs.element.$el,
|
||||
});
|
||||
this.isLoading=true
|
||||
|
||||
const data = {
|
||||
usuario: this.usuario.trim(),
|
||||
@@ -79,7 +70,7 @@ export default {
|
||||
axios
|
||||
.post(`${process.env.api}/usuario/login`, data)
|
||||
.then((resp) => {
|
||||
loadingComponent.close();
|
||||
|
||||
|
||||
window.localStorage.setItem("idUsuario", resp.data.Usuario.idUsuario);
|
||||
window.localStorage.setItem("token", resp.data.token);
|
||||
@@ -96,7 +87,7 @@ export default {
|
||||
this.$router.push(`/${resp.data.Usuario.TipoUsuario.tipoUsuario}`);
|
||||
})
|
||||
.catch((error) => {
|
||||
loadingComponent.close();
|
||||
|
||||
this.$buefy.dialog.alert({
|
||||
title: "Error",
|
||||
message: error.response.data.message,
|
||||
@@ -107,6 +98,9 @@ export default {
|
||||
ariaRole: "alertdialog",
|
||||
ariaModal: true,
|
||||
});
|
||||
})
|
||||
.finally(()=>{
|
||||
this.isLoading =false
|
||||
});
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user