import Vue from 'vue' import Vuex from 'vuex' import ajax from '@/api/userApi' import { getToken } from '@/utils/auth' // import router from '@/router' Vue.use(Vuex) const store = new Vuex.Store({ state: { isLogin: false, luyou: 1, userInfo: { userid: "", username: "", type: 2, }, Notify: [], NotifyDig: false, systemState: 1, nCount: 0, report: "", // api: 'https://pbl.cocorobo.cn/api/pbl', // socket: "https://poll.cocorobo.cn", // socket: "http://localhost:1473", // api: 'http://10.3.16.226:7003/api', api: 'https://cxcy.ssti.net.cn/api', //服务器 // api: 'http://127.0.0.1:7003/api', // api: 'http://10.3.16.59:7003/api',//qgt后端 }, mutations: { update(state, [key, value]) { state[key] = value; }, getPlanEndProjectData(state) { console.log("获取信息") ajax.get(state.api + "/SelectProjectEndData", { uid: state.userInfo.userid }).then(res => { state.Notify = res['data'][0]; if (state.Notify.length > 0) state.NotifyDig = true; console.log(res['data'][0]) }).catch(err => { console.log(err) }) } }, }) export default store