/*
 * @Author: Z 1518051043@qq.com
 * @Date: 2025-12-01 13:52:20
 * @LastEditors: zwy 1518051043@qq.com
 * @LastEditTime: 2025-12-31 15:46:20
 * @FilePath: \yuanxinPro\src\utils\requestSocekt.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import HeartbeatInterval from '@/store/module/app.js'
// const apiUrl = `ws://121.229.107.155:19021/trackInfo`
const apiUrl = `ws://121.229.107.155:19021/TestTimeSend`
const wss = new WebSocket(apiUrl);
wss.onopen = () => { 
};
wss.onclose = () => {
  clearInterval(HeartbeatInterval);
  console.log('WebSocket disconnected, attempting reconnect...');
  setTimeout(() => {
    // 自动重连逻辑
    new WebSocket(apiUrl);
  }, 5000);
};

export default wss;
