import Vue from 'vue' import Vuex from 'vuex' import user from './model/user' //引入axios模块(先下载`axios`--) // import axios from 'axios' // import axios from 'axios' //将axios挂载在vue原型链上 // Vue.prototype.$axios = axios; // Vue.prototype.$axios = axios Vue.use(Vuex) const store = new Vuex.Store({ state: { // #ifdef H5 baseURL: 'https://xxl.liuniu946.com', //请求地址配置 // #endif // #ifdef MP baseURL: 'https://xxl.liuniu946.com', //请求地址配置 // #endif urlFile: '/index', //项目部署所在文件夹 userInfo: {}, //登录信息 loginInterceptor: false, //是否打开强制登录 // #ifdef H5 || MP-WEIXIN weichatInfo: {}, //保存微信注册信息 weichatObj: '', //微信对象 // #endif latitude: '28.67307', longitude: '121.44297', chooseProvince: '', chooseCity: '', chooseDistrict: '', }, mutations: { //保存微信信息 setWeiChatInfo(state, provider) { state.weichatInfo = provider; }, //保存微信对象 setWeiChatObj(state, provider) { state.weichatObj = provider; }, setLat(state, provider) { state.latitude = provider }, setLon(state, provider) { state.longitude = provider }, setChoose(state,provider) { state.chooseProvince = provider.chooseProvince state.chooseCity = provider.chooseCity state.chooseDistrict = provider.chooseDistrict console.log(state.chooseProvince,state.chooseCity,state.chooseDistrict,'dddddddddddddddddddd') }, setDistrict(state,provider) { state.chooseDistrict = provider } }, modules: { user }, actions: {} }) export default store