24 lines
443 B
JavaScript
24 lines
443 B
JavaScript
import { createStore } from 'vuex'
|
|
import createPersistedState from "vuex-persistedstate"
|
|
const store = createStore({
|
|
state () {
|
|
return {
|
|
staff: null
|
|
}
|
|
},
|
|
mutations: {
|
|
setStaff(state, staff) {
|
|
state.staff = staff
|
|
},
|
|
updateToken(state, Token) {
|
|
state.staff.Token = Token
|
|
},
|
|
clearStaff(state) {
|
|
state.staff = null
|
|
},
|
|
},
|
|
plugins: [createPersistedState()]
|
|
})
|
|
|
|
|
|
export default store |