init_info.js 1.15 KB


const info = {
  state: {
    dev_unid: '',
    bodyheight:'',
    org:[],
    address:[],
    facedbdata:[],
    province:[],
  },
  mutations:{
    SET_DEV: (state, dev) => {
      state.dev_unid = dev;
    },
    SET_BODYHEIGHT: (state, height) => {
      state.bodyheight = height
    },
    SET_ORG: (state, data) =>{
      state.org = data;
    },
    SET_ADDRESS: (state, data) => {
      state.address = data;
    },
    SET_FACEDB: (state, data) => {
      state.facedbdata = data;
    },
    SET_PROVINCE: (state, data) => {
      state.province = data;
    }
  },
  actions: {
    GetDev({ commit, state}) {
      // getDev().then(response => {
      //   response.data
      //   let data = "9cb6e39adc5176b81879f6c22f1d963"
      //   if( response.data &&  response.data.length > 0){
      //     data =  response.data[0];
      //   }
      //   commit("SET_DEV", data);
      // })
    },

  },
}

/**
 * 获取设备IP
 */
// function getDev() {
//   return new Promise((reslove, reject) =>{
//     axios.get(IP + '/api/v1/devconf_fx/devs?s=' + new Date().getTime()).then(response => {
//       reslove(response);
//     })
//   });
// }

export default info