fix: 修复退出还能收到推送的情况
This commit is contained in:
@@ -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
|
||||
|
||||
Submodule resources/mobile updated: 25571a0726...8533b26fe6
Reference in New Issue
Block a user