This commit is contained in:
2018-11-13 22:44:16 +00:00
parent 15daaebab9
commit a31093d50d
4 changed files with 12 additions and 20 deletions

View File

@@ -11,23 +11,28 @@ export default new Vuex.Store({
apiUrl: "http://localhost:7575/api/v8.0/",
userId: 0,
roles: 0,
localeText: {},
navItems: []
},
mutations: {
setAuthentication(state, data) {
login(state, data) {
// mutate state
state.authenticated = data.authenticated;
state.userId = data.userId;
state.roles = data.roles;
},
clearAuthentication(state) {
logout(state) {
state.authenticated = false;
state.userId = 0;
state.roles = 0;
state.navItems = [];
state.localeText = [];
},
addNavItem(state, data) {
state.navItems.push(data);
},
addLocaleText(state, data) {
state.localeText[data.key] = data.value;
}
},
actions: {}