import { reqLogin } from "@/request/api.js"; const state = { loginInfo: {}, //当前登录用户信息 }; const getters = {}; const mutations = { // 登录 vxLogin(state, args) { state.loginInfo = args || {}; }, // 修改当前登录用户信息 changeLoginInfo(state, args) { state.loginInfo.user = args || {}; }, }; const actions = { // 登录 async vxLogin({ commit }, args) { let result = await reqLogin(args); if (result.status == 200) { commit("vxLogin", result.user); } return result; }, }; export default { namespaced: true, state, getters, mutations, actions, };