Avisos registro
This commit is contained in:
@@ -85,7 +85,21 @@ module.exports = configure(function (/* ctx */) {
|
||||
|
||||
// https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework
|
||||
framework: {
|
||||
config: {},
|
||||
config: {
|
||||
brand: {
|
||||
primary: "#00a352",
|
||||
secondary: "#2668a6",
|
||||
accent: "#9C27B0",
|
||||
|
||||
dark: "#1d1d1d",
|
||||
"dark-page": "#121212",
|
||||
|
||||
positive: "#21BA45",
|
||||
negative: "#C10015",
|
||||
info: "#31CCEC",
|
||||
warning: "#F2C037",
|
||||
},
|
||||
},
|
||||
|
||||
// iconSet: 'material-icons', // Quasar icon set
|
||||
// lang: 'en-US', // Quasar language pack
|
||||
@@ -98,7 +112,7 @@ module.exports = configure(function (/* ctx */) {
|
||||
// directives: [],
|
||||
|
||||
// Quasar plugins
|
||||
plugins: [],
|
||||
plugins: ["Dialog"],
|
||||
},
|
||||
|
||||
// animations: 'all', // --- includes all animations
|
||||
|
||||
@@ -103,10 +103,16 @@
|
||||
<script setup>
|
||||
import { ref, computed } from "vue";
|
||||
import { useListaStore } from "../stores/lista.js";
|
||||
import { useQuasar } from "quasar";
|
||||
import { useRouter } from "vue-router";
|
||||
|
||||
const listaStore = useListaStore();
|
||||
const $q = useQuasar();
|
||||
const $router = useRouter();
|
||||
|
||||
const email = ref("");
|
||||
const password = ref("");
|
||||
const username = ref(""); //No exista en la bd, tamaño mínimo
|
||||
const username = ref("");
|
||||
const confirmpassword = ref("");
|
||||
const nombre = ref("");
|
||||
const usuarios = ref([]);
|
||||
@@ -115,6 +121,7 @@ const recibeDatos = () => {
|
||||
listaStore.getUsers().then(function (item) {
|
||||
usuarios.value = item;
|
||||
});
|
||||
console.log(usuarios.value);
|
||||
};
|
||||
const comprobarUsername = computed(() => {
|
||||
let filtro = usuarios.value?.filter(
|
||||
@@ -170,7 +177,14 @@ const registrar = () => {
|
||||
passwordConfirm: confirmpassword.value,
|
||||
name: nombre.value,
|
||||
};
|
||||
listaStore.register(data);
|
||||
listaStore.register(data).then((r) => {
|
||||
$q.dialog({
|
||||
title: "Aviso",
|
||||
message: "Se le ha enviado un correo electrónico que debe verificar",
|
||||
}).onOk(() => {
|
||||
$router.push("/");
|
||||
});
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -44,20 +44,13 @@ export const useListaStore = defineStore("lista", () => {
|
||||
sort: "-created",
|
||||
});
|
||||
}
|
||||
|
||||
async function register(data) {
|
||||
console.log(data);
|
||||
const record = await pb
|
||||
.collection("users")
|
||||
.create(data)
|
||||
.then((r) => {
|
||||
pb.collection("users")
|
||||
.requestVerification(data.email)
|
||||
.then((r) => {
|
||||
console.log("email enviado");
|
||||
this.router.push("/login");
|
||||
});
|
||||
console.log("Correcto");
|
||||
pb.collection("users").requestVerification(data.email);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e);
|
||||
|
||||
Reference in New Issue
Block a user