2024-06-19对 websocket 进行封装 (心跳检测 断开重连 发送事件等等 支持断开重连后发送上次发送的最后一个事件)代码封装: //websocketService.jsimport{ref}from"vue";const{DEV,VITE_APP_PUSH_WS}=import.meta.env;const{push_ws}=window.WEB_CONFIG;constbaseWsUrl=DEV?VITE_APP_PUSH_WS:push_ws;classWebSocketService{constructor(ur