Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2018-01-09 17:52:26 +01:00
parent 8ac705d8c2
commit 92d2045735
97 changed files with 18243 additions and 1544 deletions

21
js/src/store/index.js Normal file
View File

@@ -0,0 +1,21 @@
import { LOGIN_USER, LOGOUT_USER, SAVE_USER } from './mutation-types';
const state = {
isLogged: !!localStorage.getItem('token'),
user: false,
};
const mutations = {
[LOGIN_USER](state) {
state.isLogged = true;
},
[LOGOUT_USER](state) {
state.isLogged = false;
},
[SAVE_USER](state, user) {
state.user = user;
},
};
export default { state, mutations };