verify-email

This commit is contained in:
DESKTOP-1R2VSQH\Lenovo ThinkPad E490 2024-11-21 15:11:55 +07:00
parent 3bb91201d8
commit 4a8bad8002
2 changed files with 42 additions and 2 deletions

View file

@ -79,7 +79,7 @@ const router = createRouter({
},
},
{
path: "/verifyemail",
path: "/verifyemail/:token",
name: "verifyemail",
component: VerifyEmail,
},

View file

@ -1,4 +1,44 @@
<script setup lang="ts"></script>
<script setup lang="ts">
import { onMounted, ref } from "vue";
import axios from "axios";
import { useQuasar } from "quasar";
import { useCounterMixin } from "@/stores/mixin";
import { useRoute } from "vue-router";
import env from "@/api/index";
const $q = useQuasar();
const route = useRoute();
const { showLoader, hideLoader, messageError } = useCounterMixin();
const pathApi = ref<string>(`${env.API_URI}/profile/verify-email`);
const token = ref(route.params.token);
async function fetchCheckVerifEemail() {
showLoader();
await axios
.post(
pathApi.value,
{ token: token.value },
{
headers: {
"Content-Type": "application/json; charset=utf-8",
},
}
)
.then(() => {})
.catch((err) => {
// messageError($q, err);
})
.finally(() => {
hideLoader();
});
}
onMounted(() => {
fetchCheckVerifEemail();
});
</script>
<template>
<div