ref |> 处理退出登录或注销 取消推送别名设置
Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
3 changed files
with
7 additions
and
4 deletions
| @@ -13,7 +13,7 @@ export class EmitterUtils { | @@ -13,7 +13,7 @@ export class EmitterUtils { | ||
| 13 | static sendEmptyEvent(eventId: number) { | 13 | static sendEmptyEvent(eventId: number) { |
| 14 | let event: emitter.InnerEvent = { | 14 | let event: emitter.InnerEvent = { |
| 15 | eventId: eventId, | 15 | eventId: eventId, |
| 16 | - priority: emitter.EventPriority.LOW | 16 | + priority: emitter.EventPriority.IMMEDIATE |
| 17 | }; | 17 | }; |
| 18 | emitter.emit(event); | 18 | emitter.emit(event); |
| 19 | } | 19 | } |
| @@ -26,7 +26,7 @@ export class EmitterUtils { | @@ -26,7 +26,7 @@ export class EmitterUtils { | ||
| 26 | static sendEvent(eventId: number, str?: string | number) { | 26 | static sendEvent(eventId: number, str?: string | number) { |
| 27 | let event: emitter.InnerEvent = { | 27 | let event: emitter.InnerEvent = { |
| 28 | eventId: eventId, | 28 | eventId: eventId, |
| 29 | - priority: emitter.EventPriority.LOW | 29 | + priority: emitter.EventPriority.IMMEDIATE |
| 30 | }; | 30 | }; |
| 31 | let eventData: emitter.EventData = { | 31 | let eventData: emitter.EventData = { |
| 32 | data: { | 32 | data: { |
| @@ -486,6 +486,7 @@ export struct AccountAndSecurityLayout { | @@ -486,6 +486,7 @@ export struct AccountAndSecurityLayout { | ||
| 486 | let login = new LoginViewModel; | 486 | let login = new LoginViewModel; |
| 487 | login.logOut().then(()=>{ | 487 | login.logOut().then(()=>{ |
| 488 | this.showToastTip('退出登录') | 488 | this.showToastTip('退出登录') |
| 489 | + EmitterUtils.sendEvent(EmitterEventId.FORCE_USER_LOGIN_OUT) | ||
| 489 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) | 490 | EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) |
| 490 | router.back(); | 491 | router.back(); |
| 491 | }).catch((error:string)=>{ | 492 | }).catch((error:string)=>{ |
| @@ -498,6 +499,8 @@ export struct AccountAndSecurityLayout { | @@ -498,6 +499,8 @@ export struct AccountAndSecurityLayout { | ||
| 498 | TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) | 499 | TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account) |
| 499 | this.logoutViewModel.requestLogout().then(()=>{ | 500 | this.logoutViewModel.requestLogout().then(()=>{ |
| 500 | ToastUtils.shortToast("注销成功") | 501 | ToastUtils.shortToast("注销成功") |
| 502 | + EmitterUtils.sendEmptyEvent(EmitterEventId.FORCE_USER_LOGIN_OUT) | ||
| 503 | + EmitterUtils.sendEmptyEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION) | ||
| 501 | router.back() | 504 | router.back() |
| 502 | }) | 505 | }) |
| 503 | } | 506 | } |
| @@ -95,7 +95,7 @@ export class GetuiPush { | @@ -95,7 +95,7 @@ export class GetuiPush { | ||
| 95 | if (!this.initialed) { return } | 95 | if (!this.initialed) { return } |
| 96 | if (HttpUtils.isLogin()) { | 96 | if (HttpUtils.isLogin()) { |
| 97 | const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | 97 | const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string |
| 98 | - this.currentUserId = userId | 98 | + this.currentUserId = userId + "" |
| 99 | this.setAlias(true, userId) | 99 | this.setAlias(true, userId) |
| 100 | } | 100 | } |
| 101 | let tags = [this.TAG_PD_ZH, AppUtils.getAppVersionCode()] | 101 | let tags = [this.TAG_PD_ZH, AppUtils.getAppVersionCode()] |
| @@ -112,7 +112,7 @@ export class GetuiPush { | @@ -112,7 +112,7 @@ export class GetuiPush { | ||
| 112 | // 登录和退出 | 112 | // 登录和退出 |
| 113 | EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { | 113 | EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => { |
| 114 | const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string | 114 | const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string |
| 115 | - this.currentUserId = userId | 115 | + this.currentUserId = userId + "" |
| 116 | this.setAlias(true, userId) | 116 | this.setAlias(true, userId) |
| 117 | }) | 117 | }) |
| 118 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { | 118 | EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => { |
-
Please register or login to post a comment