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.
40 lines
670 B
40 lines
670 B
import Vue from 'vue'
|
|
import Vuex from 'vuex'
|
|
Vue.use(Vuex)
|
|
|
|
export default new Vuex.Store({
|
|
state:{
|
|
userInfo:{},
|
|
token:"",
|
|
plantBaseInfoId:"",
|
|
},
|
|
getters:{
|
|
userInfo: state=>state.userInfo,
|
|
token: state=>state.token,
|
|
},
|
|
mutations:{
|
|
setUserInfo(state, val){
|
|
state.userInfo={
|
|
...val.userInfo,
|
|
companyName:val.departs[0].departName
|
|
}
|
|
state.token=val.token
|
|
},
|
|
outLogin(state){
|
|
state.userInfo={}
|
|
state.token=''
|
|
// uni.reLaunch({
|
|
// url:"/pages/home/login",
|
|
// })
|
|
},
|
|
setHeadImg(state,val){
|
|
state.userInfo.avatar=val
|
|
},
|
|
setBaseId(state, val){//基地id
|
|
state.plantBaseInfoId = val
|
|
},
|
|
},
|
|
actions:{
|
|
|
|
}
|
|
})
|