Migrated to nuxt-js frontend framework

This commit is contained in:
2020-04-17 18:57:05 +02:00
parent 8fe229b3d6
commit 1917e2e9fc
32 changed files with 8446 additions and 15 deletions
+27
View File
@@ -0,0 +1,27 @@
import {clearToken, setToken} from "@/services/LocalStorageService";
export const state = () => ({
token: ''
})
export const mutations = {
setToken(state, token) {
state.token = token
setToken(token)
},
clearToken(state) {
state.token = null
clearToken()
},
initToken(state) {
state.token = localStorage.getItem('token')
}
}
export const actions = {}
export const getters = {
isLoggedIn(state) {
return state.token !== null && state.token !== ''
}
}