You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
636 B
30 lines
636 B
|
|
export const state = {
|
|
//用户数据
|
|
userInfo: {},
|
|
};
|
|
export const mutations = {
|
|
//储存用户信息
|
|
setUserInfo(state, data) {
|
|
if (data) {
|
|
state.userInfo = Object.assign({}, state.userInfo,data);
|
|
|
|
// #ifndef H5
|
|
uni.setStorageSync('userInfo', state.userInfo);
|
|
// #endif
|
|
}else{
|
|
state.userInfo = null
|
|
}
|
|
},
|
|
// 退出APP
|
|
emptyUserInfo(state) {
|
|
state.userInfo = {};
|
|
|
|
// #ifndef H5
|
|
uni.removeStorageSync("userInfo");
|
|
// #endif
|
|
},
|
|
};
|
|
export const actions = {
|
|
|
|
};
|
|
|