luohairen
2024-10-29 7aa55ce4b2c5f5ae324f145bdf1766cdb376210a
src/views/meet/index.vue
@@ -102,7 +102,7 @@
      this.sendMessage(JSON.stringify(command))
    },
    initWebSocket () {
      this.ws = new WebSocket('wss://www.kgmeet.com:18080/websocket/' + JSON.parse(Cookies.get('adminUserInfo')).id)
      this.ws = new WebSocket('wss://ycl.easyblog.vip:81/websocket/' + JSON.parse(Cookies.get('adminUserInfo')).id)
      let ws = this.ws
      ws.onopen = () => {
        console.log('WebSocket 连接成功')
@@ -278,13 +278,15 @@
    this.jitsiApi.addListener('readyToClose', () => {
      window.close()
    })
    // 初始化
    this.initWebSocket()
    // 每三秒更学员在线状态
    this.intervalId = setInterval(() => {
      this.getRoomInfo()
      // 发送心跳数据
      this.ws.send('ping')
    }, 2500)
    // 初始化
    this.initWebSocket()
  },
  beforeDestroy () {
    // 清除定时器,避免内存泄漏