mirror of
https://gitee.com/lyt-top/vue-next-admin
synced 2026-07-07 14:25:21 +08:00
27 lines
495 B
JavaScript
27 lines
495 B
JavaScript
import { Session } from '/@/utils/storage';
|
|
|
|
const userInfosModule = {
|
|
namespaced: true,
|
|
state: {
|
|
userInfos: {},
|
|
},
|
|
mutations: {
|
|
// 设置用户信息
|
|
getUserInfos(state, data) {
|
|
state.userInfos = data;
|
|
},
|
|
},
|
|
actions: {
|
|
// 设置用户信息
|
|
async setUserInfos({ commit }, data) {
|
|
if (data) {
|
|
commit('getUserInfos', data);
|
|
} else {
|
|
if (Session.get('userInfo')) commit('getUserInfos', Session.get('userInfo'));
|
|
}
|
|
},
|
|
},
|
|
};
|
|
|
|
export default userInfosModule;
|