import { state,State } from './state';
import { createStore } from 'vuex';
import createPersistedState from "vuex-persistedstate";
import api from '@/api'
export default createStore({
  plugins:[createPersistedState()],
  state,
  mutations: {
    SET_USERINFO(state,payload:State["userInfo"]){
      state.userInfo = payload
      return

    }

  },
  actions: {
    getUserInfo(){
      api.user.studentUserInfo().then(res=>{
        this.commit('SET_USERINFO',res.data.data)
      })
     



    }

  },
  modules: {},
});
