const state = { userInfo: {}, token: "", refreshToken: "" } const mutations = { setToken(state, params) { state.token = params; }, setUserInfo(state, params) { state.userInfo = params; }, setRefreshToken(state, params) { state.refreshToken = params; } } const getters = { token(state) { return state.token }, userInfo(state) { return state.userInfo }, refreshToken(state) { return state.refreshToken; } } export default { state, mutations, getters }