the merge project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
794 B

4 years ago
import {createStore} from 'vuex'
import axios from "axios";
4 years ago
export default createStore({
state: {
player: null,
4 years ago
inventory: []
},
getters: {},
mutations: {
fetchUser(state) {
let existingUserUuid = localStorage.getItem('farmfresh_uuid');
if (existingUserUuid != null) {
axios.get(
'http://api.luna-development.net/api/player/fetch/'+existingUserUuid
).then((response) => {
if (response.data && response.data.uuid) {
state.player = response.data;
} else {
alert('User not found');
}
});
}
}
},
4 years ago
actions: {},
modules: {}
})