Commit a0573ab2 authored by raphael.peim's avatar raphael.peim

Update Navbar.vue

parent 5e412f5f
......@@ -23,7 +23,7 @@
<b-dropdown-item><router-link to="">Classement</router-link></b-dropdown-item>
</b-nav-item-dropdown>
<b-nav-item-dropdown text="Utilisateur" right>
<b-nav-item-dropdown :text="login" right>
<b-dropdown-item><router-link to="/profile">Profil</router-link></b-dropdown-item>
<b-dropdown-item @click="onClick"><router-link to="">Déconnexion</router-link></b-dropdown-item>
</b-nav-item-dropdown>
......@@ -37,6 +37,9 @@
export default {
name: 'Navbar',
components: {},
data() {
return { login: localStorage.login}
},
methods: {
onClick() {
if (confirm("Etes-vous sûr de vouloir vous déconnecter ?")) {
......
......@@ -79,6 +79,7 @@
if (areEqual) {
// Enregistrement du token et redirection
this.getToken(row.login, row.password).then(token => {
localStorage.setItem('login', row.login)
localStorage.setItem('token', token)
window.location.href = "/#/home"
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment