Browse Source

登录后从新加载就请求一次用户状态

master
liaoxinyu 2 years ago
parent
commit
b7c3a51759
  1. 10
      App.vue

10
App.vue

@ -29,9 +29,9 @@ export default {
},
sendHeartbeat() {
Home.online().then((response) => {
console.log('心跳机制');
}).catch((err) => {});
Home.online().then((response) => {
console.log('心跳机制');
}).catch((err) => {});
},
startHeartbeat() {
if (!this.heartbeatInterval && this.isLogin) {
@ -171,6 +171,10 @@ export default {
mounted() {
//
document.addEventListener('visibilitychange', this.handleVisibilityChange);
//
if (this.isLogin){
this.sendHeartbeat()
}
//
this.startHeartbeat();
},

Loading…
Cancel
Save