import { getUserInfoApi } from '@/api'; export default { state: { userInfo: {}, }, mutations: { setUserInfo(state, userInfo) { state.userInfo = userInfo; }, }, actions: { async getUserInfo({ commit }) { const userInfo = await getUserInfoApi(); commit('setUserInfo', userInfo); }, }, };