import { reqLogin } from "@/request/api.js"; const state = { loginInfo: {}, //当前登录用户信息 loginInfoUserDeptId: undefined, //当前登录用户所属科室id }; const getters = {}; const mutations = { vxLogin(state, args) { state.loginInfo = args; state.loginInfoUserDeptId = args.user.dept.id; }, }; 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, };