2023-11-27 18:23:17 +08:00
|
|
|
import {
|
|
|
|
createStore
|
|
|
|
} from 'vuex'
|
|
|
|
const store = createStore({
|
|
|
|
state: {
|
|
|
|
userInfo:uni.getStorageSync("SY_USER")||null,
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
mutations: {
|
|
|
|
saveUserInfo(state, info) {
|
|
|
|
state.userInfo = info
|
|
|
|
uni.setStorageSync("SY_USER", info)
|
|
|
|
}
|
|
|
|
},
|
|
|
|
actions: {
|
2023-12-01 10:54:01 +08:00
|
|
|
saveUserInfo({commit}, info) {
|
|
|
|
|
2023-11-27 18:23:17 +08:00
|
|
|
commit('saveUserInfo', info)
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
export default store
|