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
699 B

export default {
SET_TOKEN(state, token) {
state.token = token
uni.setStorageSync('token', token)
},
REMOVE_TOKEN(state) {
state.token = null
uni.removeStorageSync('token')
},
SET_USER_INFO(state, userInfo) {
state.userInfo = userInfo
uni.setStorageSync('userInfo')
},
REMOVE_USER_INFO(state) {
state.userInfo = null
uni.removeStorageSync('userInfo')
},
SET_CONFIG(state, config) {
state.config = config
uni.setStorageSync('config')
},
GET_CONFIG(state) {
state.config = null
uni.removeStorageSync('config')
},
LOGOUT() {
this.commit('REMOVE_TOKEN')
this.commit('REMOVE_USER_INFO')
}
}