import Vue from "vue"
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
    state: {
        token: uni.getStorageSync('token') || ''
    },
    getters: {
        getToken: state => {
            return state.token
        }
    },
    mutations: {
        setToken(state, tokenString) {
            state.token = tokenString
            uni.setStorageSync('token', tokenString)
        }
    },
    medules: {
        
    }
})