import WebConnection from "@/utils/webconnection"; /** * 该对象废弃,放到:user组件中了 * @type {{mutations: {SET_CONNECTION: websocket.mutations.SET_CONNECTION, SET_WS_MSG: websocket.mutations.SET_WS_MSG}, state: {webConnection: null, webSocketMsg: null}, actions: {CreateWebConnection({commit: *}, *): void}}} */ const websocket = { state: { webConnection: null, webSocketMsg: null }, mutations: { SET_CONNECTION: (state, data) => { // var webConnection = new WebConnection(); WebConnection.setInfo(data.uri, data.uid); state.webConnection = WebConnection; }, SET_WS_MSG: (state, data)=>{ state.webSocketMsg = data; } }, actions: { CreateWebConnection({ commit }, data){ commit('SET_CONNECTION', data); } } } export default websocket