@ -171,6 +171,10 @@ export default {
mounted() {
// 监听页面可见性变化
document.addEventListener('visibilitychange', this.handleVisibilityChange);
// 立即发送一次心跳请求
if (this.isLogin){
this.sendHeartbeat()
}
// 启动心跳机制
this.startHeartbeat();
},