import Vue from 'vue'
import Vuex from 'vuex'
// import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        // pid:'',  //项目id
        isLogin: false,
        luyou: 1,
        userInfo: {
                userid:"55f791b7-be42-11ed-b8f7-509a4c5b67cf",
                username:"test@qq.com",
                sessionid:null,
                type:1,
                tname:"测试账号",
                classid:"",
                state:0,
        },
        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: 'http://127.0.0.1:7003/api',
        // api: 'http://10.3.13.84:7003/api',

    },

    mutations: {
        update(state, [key, value]) {
            state[key] = value;
        },
    },
//   plugins:[createPersistedState()]
})

export default store