<script setup lang="ts">


// let Token =localStorage.getItem('TOKEN')
import { globalEventBus } from '@/common/eventBus'
import { Push } from '@/common/push'
import { areaObj } from "@/store/index.js"
const userInfoStore=areaObj()
userInfoStore.changeUserInfoFn(510521)

var connection = new Push({
  url: 'ws://192.168.1.10:3131', // websocket地址
  app_key: 'aaea61749929eb53a4bd75a1474c1d27',
});
// 假设用户uid为1
var uid = 3;
// 浏览器监听user-2频道的消息，也就是用户uid为1的用户消息
var user_channel = connection.subscribe('user-' + uid);

// 当user-2频道有message事件的消息时
user_channel.on('message', function (data) {
    globalEventBus.emit(data.content.event, data.content.data)


    console.log("收到消息",data)

});
// 断线事件
user_channel.on('close', function () {

});


</script>
<template>
    <router-view></router-view>
  <div>
  </div>
</template>



<style lang="scss">
@import '/static/font/font.css';

* {
  margin: 0;
  padding: 0;
}



.color-font {
  font-family: FZCYJ;
  color: #E5EFFF;
  background: linear-gradient(to bottom, #DAE8FE 30%, #53A0FF 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
</style>