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.

36 lines
575 B

2 years ago
import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)
export default new Vuex.Store({
2 years ago
state:{
userInfo:{},
token:"",
},
2 years ago
getters:{
2 years ago
userInfo: state=>state.userInfo,
token: state=>state.token,
2 years ago
},
mutations:{
2 years ago
setUserInfo(state, val){
2 years ago
state.userInfo={
...val.userInfo,
companyName:val.departs[0].departName
}
2 years ago
state.token=val.token
2 years ago
},
outLogin(state){
state.userInfo={}
state.token=''
2 years ago
// uni.reLaunch({
// url:"/pages/home/login",
// })
2 years ago
},
setHeadImg(state,val){
state.userInfo.avatar=val
},
},
2 years ago
actions:{
}
2 years ago
})