fix: 修复退出还能收到推送的情况

This commit is contained in:
kuaifan
2024-11-22 17:23:54 +08:00
parent 88aee1e3bf
commit 764bf6dd55
3 changed files with 31 additions and 12 deletions

View File

@@ -122,20 +122,29 @@ export default {
handler() {
this.$store.dispatch("websocketConnection");
//
if (this.userId > 0 && this.$isEEUiApp) {
$A.eeuiAppSendMessage({
action: 'initApp',
apiUrl: $A.apiUrl(''),
userid: this.userId,
token: this.userToken,
userAgent: window.navigator.userAgent,
});
setTimeout(_ => {
if (this.$isEEUiApp) {
this.umengAliasTimer && clearTimeout(this.umengAliasTimer)
if (this.userId > 0) {
$A.eeuiAppSendMessage({
action: 'setUmengAlias',
action: 'initApp',
apiUrl: $A.apiUrl(''),
userid: this.userId,
token: this.userToken,
userAgent: window.navigator.userAgent,
});
this.umengAliasTimer = setTimeout(_ => {
this.umengAliasTimer = null;
$A.eeuiAppSendMessage({
action: 'setUmengAlias',
url: $A.apiUrl('users/umeng/alias')
});
}, 6000)
} else {
$A.eeuiAppSendMessage({
action: 'delUmengAlias',
url: $A.apiUrl('users/umeng/alias')
});
}, 6000)
}
}
},
immediate: true