Update Back-end connection & fonction Front-end
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
|
||||||
<v-list-item v-if="currentUser">
|
<v-list-item v-if="currentUser">
|
||||||
<v-btn @click="handleLogout" class="full-width-btn" flat>Déconnecter</v-btn>
|
<v-btn @click="logout" class="full-width-btn" flat>Déconnecter</v-btn>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-menu>
|
</v-menu>
|
||||||
@@ -97,7 +97,7 @@
|
|||||||
<v-list-item v-if="currentUser" @click="openWalletDialog" prepend-icon="mdi-wallet" title="Bourse"
|
<v-list-item v-if="currentUser" @click="openWalletDialog" prepend-icon="mdi-wallet" title="Bourse"
|
||||||
value="wallet"></v-list-item>
|
value="wallet"></v-list-item>
|
||||||
|
|
||||||
<v-list-item v-if="currentUser" @click="handleLogout" style="margin-top: 110%;" prepend-icon="mdi-logout"
|
<v-list-item v-if="currentUser" @click="logout" style="margin-top: 110%;" prepend-icon="mdi-logout"
|
||||||
title="Déconnecter" value="logout"></v-list-item>
|
title="Déconnecter" value="logout"></v-list-item>
|
||||||
</v-list>
|
</v-list>
|
||||||
</v-navigation-drawer>
|
</v-navigation-drawer>
|
||||||
@@ -191,14 +191,6 @@ function logout() {
|
|||||||
localStorage.removeItem('jwt');
|
localStorage.removeItem('jwt');
|
||||||
currentUser = null;
|
currentUser = null;
|
||||||
currentUserName.value = "INVITÉ";
|
currentUserName.value = "INVITÉ";
|
||||||
}
|
|
||||||
|
|
||||||
function handleLogout() {
|
|
||||||
logout();
|
|
||||||
Reroot();
|
|
||||||
}
|
|
||||||
|
|
||||||
function Reroot() {
|
|
||||||
router.push('/');
|
router.push('/');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<DefaultLayout style="margin-bottom: 30px"></DefaultLayout>
|
<DefaultLayout style="margin-bottom: 30px"></DefaultLayout>
|
||||||
|
|
||||||
<!--
|
<!-- Router Info and user informations
|
||||||
<v-container style="margin-top: -1%; margin-bottom: 2%;">
|
<v-container style="margin-top: -1%; margin-bottom: 2%;">
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col align="center">
|
<v-col align="center">
|
||||||
@@ -246,9 +246,6 @@
|
|||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</v-col>
|
</v-col>
|
||||||
|
|
||||||
|
|
||||||
@@ -322,7 +319,6 @@ import StripePayment from '../views/StripePayment.vue';
|
|||||||
|
|
||||||
const PublicCreatorData = ref(null);
|
const PublicCreatorData = ref(null);
|
||||||
const selectedUsername = ref('');
|
const selectedUsername = ref('');
|
||||||
const manualUsername = ref('');
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const client = useClient();
|
const client = useClient();
|
||||||
|
|
||||||
@@ -348,7 +344,7 @@ let navigationItems = [
|
|||||||
const fetchUser = async (username) => {
|
const fetchUser = async (username) => {
|
||||||
console.log(`Fetching user: ${username}`);
|
console.log(`Fetching user: ${username}`);
|
||||||
try {
|
try {
|
||||||
const response = await client.get(`/api/GetCreatorInfo`, {
|
const response = await client.get(`/api/Users`, {
|
||||||
params: {
|
params: {
|
||||||
UserName: username
|
UserName: username
|
||||||
}
|
}
|
||||||
@@ -382,10 +378,6 @@ const updateUser = () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const manualFetch = () => {
|
|
||||||
fetchUser(manualUsername.value);
|
|
||||||
};
|
|
||||||
|
|
||||||
onMounted(updateUser);
|
onMounted(updateUser);
|
||||||
|
|
||||||
watch(() => route.params.username, updateUser);
|
watch(() => route.params.username, updateUser);
|
||||||
|
|||||||
Reference in New Issue
Block a user