mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
remove loginAPI calls from store
This commit is contained in:
parent
4a8ba8d385
commit
810bd6d0ba
@ -70,7 +70,6 @@
|
||||
<script>
|
||||
import NavbarToggleButton from '@/components/NavbarToggleButton'
|
||||
import VueQrcode from 'vue-qrcode'
|
||||
import loginAPI from '../../apis/loginAPI'
|
||||
|
||||
export default {
|
||||
name: 'sidebar',
|
||||
@ -102,10 +101,8 @@ export default {
|
||||
showSidebar() {
|
||||
this.$sidebar.displaySidebar(true)
|
||||
},
|
||||
async logout() {
|
||||
//const result = await loginAPI.logout(this.$store.state.session_id)
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
logout() {
|
||||
this.$emit('logout')
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
import Vue from 'vue'
|
||||
import Vuex from 'vuex'
|
||||
Vue.use(Vuex)
|
||||
import loginAPI from '../apis/loginAPI'
|
||||
import communityAPI from '../apis/communityAPI'
|
||||
import createPersistedState from 'vuex-persistedstate'
|
||||
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="wrapper">
|
||||
<notifications></notifications>
|
||||
<side-bar>
|
||||
<side-bar @logout="logout">
|
||||
<template slot="links">
|
||||
<b-nav-item href="#!" to="/overview">
|
||||
<b-nav-text class="p-0 text-lg text-muted">{{ $t('send') }}</b-nav-text>
|
||||
@ -36,6 +36,7 @@
|
||||
<script>
|
||||
import PerfectScrollbar from 'perfect-scrollbar'
|
||||
import 'perfect-scrollbar/css/perfect-scrollbar.css'
|
||||
import loginAPI from '../../apis/loginAPI'
|
||||
|
||||
function hasElement(className) {
|
||||
return document.getElementsByClassName(className).length > 0
|
||||
@ -71,6 +72,12 @@ export default {
|
||||
initScrollbar('sidenav')
|
||||
}
|
||||
},
|
||||
async logout() {
|
||||
const result = await loginAPI.logout(this.$store.state.session_id)
|
||||
// do we have to check success?
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.initScrollbar()
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
<script>
|
||||
import { BaseNav } from '@/components'
|
||||
import VueQrcode from 'vue-qrcode'
|
||||
import loginAPI from '../../apis/loginAPI'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user