Files
raven/app/ayanova/src/store.js
2018-11-08 21:40:30 +00:00

29 lines
564 B
JavaScript

import Vue from "vue";
import Vuex from "vuex";
Vue.use(Vuex);
export default new Vuex.Store({
state: {
authenticated: false,
apiUrl: "http://localhost:7575/api/v8.0/",
userId: 0,
roles: 0,
navItems: []
},
mutations: {
authenticated(state, data) {
// mutate state
state.authenticated = data.authenticated;
state.userId = data.userId;
state.roles = data.roles;
},
notAuthenticated(state) {
state.authenticated = false;
state.userId = 0;
state.roles = 0;
}
},
actions: {}
});