mutations.js 912 Bytes
Newer Older
程默 committed
1
const mutations = {
chenhui committed
2 3 4
  setSpokesman(state, obj) {
    for (let [key, val] of Object.entries(obj)) {
      state[key] = val;
程默 committed
5
    }
chenhui committed
6 7 8
  },
  setSubscribeMessageObj(state, subscribeMessageObj) {
    state.subscribeMessageObj = subscribeMessageObj;
9 10 11 12 13
  },
  setOfflineShopCode(state, code) {
    state.offlineShopCode = code;
  },

程智春 committed
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
  //设置登录状态
  setLoginStatus(state,val){
    wx.setStorage({
        key: "isLogin",
        data: val
    });
    state.isLogin = val;
  },
  //设置用户信息
  setUserInfo(state,obj){
      wx.setStorage({
          key: "userInfo",
          data: JSON.stringify(obj)
      });
      state.userInfo = obj;
  },
  //退出登录
  logout(state){
      wx.clearStorage()
      state.isLogin = 0;
      state.userInfo = null;
程智春 committed
35 36 37
  },
  setExtConfig(state,obj){
    state.mixid = obj
程智春 committed
38 39 40
  },
  setExtConfigInfo(state,obj){
    state.extConfig = obj
程智春 committed
41 42
  }

chenhui committed
43
};
程默 committed
44
export default mutations