mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +00:00
fix: 修复退出还能收到推送的情况
This commit is contained in:
parent
88aee1e3bf
commit
764bf6dd55
@ -1115,6 +1115,9 @@ class UsersController extends AbstractController
|
||||
* @apiGroup users
|
||||
* @apiName umeng__alias
|
||||
*
|
||||
* @apiParam {String} action
|
||||
* - update: 更新(默认)
|
||||
* - remove: 删除
|
||||
* @apiParam {String} alias 别名
|
||||
*
|
||||
* @apiSuccess {Number} ret 返回状态码(1正确、0错误)
|
||||
@ -1130,6 +1133,13 @@ class UsersController extends AbstractController
|
||||
'alias.between:2,20' => '别名的长度在2-20个字符',
|
||||
]);
|
||||
//
|
||||
if ($data['action'] === 'remove') {
|
||||
if ($data['alias']) {
|
||||
UmengAlias::whereAlias($data['alias'])->delete();
|
||||
}
|
||||
return Base::retSuccess('删除成功');
|
||||
}
|
||||
//
|
||||
if (!in_array(Base::platform(), ['ios', 'android'])) {
|
||||
return Base::retError('设备类型错误');
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -1 +1 @@
|
||||
Subproject commit 25571a072613453c181edb6a642fad8a3a053b12
|
||||
Subproject commit 8533b26fe64824a3c714757aa7631f1da4413304
|
||||
Loading…
x
Reference in New Issue
Block a user