xugenyuan

ref |> 处理退出登录或注销 取消推送别名设置

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -13,7 +13,7 @@ export class EmitterUtils {
static sendEmptyEvent(eventId: number) {
let event: emitter.InnerEvent = {
eventId: eventId,
priority: emitter.EventPriority.LOW
priority: emitter.EventPriority.IMMEDIATE
};
emitter.emit(event);
}
... ... @@ -26,7 +26,7 @@ export class EmitterUtils {
static sendEvent(eventId: number, str?: string | number) {
let event: emitter.InnerEvent = {
eventId: eventId,
priority: emitter.EventPriority.LOW
priority: emitter.EventPriority.IMMEDIATE
};
let eventData: emitter.EventData = {
data: {
... ...
... ... @@ -486,6 +486,7 @@ export struct AccountAndSecurityLayout {
let login = new LoginViewModel;
login.logOut().then(()=>{
this.showToastTip('退出登录')
EmitterUtils.sendEvent(EmitterEventId.FORCE_USER_LOGIN_OUT)
EmitterUtils.sendEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION)
router.back();
}).catch((error:string)=>{
... ... @@ -498,6 +499,8 @@ export struct AccountAndSecurityLayout {
TrackingButton.click("cancelAccountPageCancelAccountSuccess",TrackConstants.PageName.Cancel_Account,TrackConstants.PageName.Cancel_Account)
this.logoutViewModel.requestLogout().then(()=>{
ToastUtils.shortToast("注销成功")
EmitterUtils.sendEmptyEvent(EmitterEventId.FORCE_USER_LOGIN_OUT)
EmitterUtils.sendEmptyEvent(EmitterEventId.PEOPLE_SHIP_ATTENTION)
router.back()
})
}
... ...
... ... @@ -95,7 +95,7 @@ export class GetuiPush {
if (!this.initialed) { return }
if (HttpUtils.isLogin()) {
const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
this.currentUserId = userId
this.currentUserId = userId + ""
this.setAlias(true, userId)
}
let tags = [this.TAG_PD_ZH, AppUtils.getAppVersionCode()]
... ... @@ -112,7 +112,7 @@ export class GetuiPush {
// 登录和退出
EmitterUtils.receiveEvent(EmitterEventId.LOGIN_SUCCESS, () => {
const userId = SPHelper.default.getSync(SpConstants.USER_ID, "") as string
this.currentUserId = userId
this.currentUserId = userId + ""
this.setAlias(true, userId)
})
EmitterUtils.receiveEvent(EmitterEventId.FORCE_USER_LOGIN_OUT, () => {
... ...