wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  ref |> 处理退出登录或注销 取消推送别名设置
  ref |> 调整推送消息跳转处理
... ... @@ -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()
})
}
... ...
... ... @@ -52,7 +52,7 @@ export class GetuiPush {
const isOnlineEnv = HostManager.getHost() === HostEnum.HOST_PRODUCT
PushManager.initialize({
appId:isOnlineEnv ? GetuiPush.GETUI_APPID_TEST : GetuiPush.GETUI_APPID_TEST,
appId:isOnlineEnv ? GetuiPush.GETUI_APPID_ONLINE : GetuiPush.GETUI_APPID_TEST,
context: context,
onSuccess: (cid:string) => {
Logger.debug(TAG, "个推SDK初始化成功,cid = " + cid)
... ... @@ -63,6 +63,8 @@ export class GetuiPush {
if (this.hasEnterMain) {
this.comsumeLastPushContent()
} else {
Logger.debug(TAG, "等待进入主页")
}
},
onFailed: (error:string) => {
... ... @@ -93,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()]
... ... @@ -110,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, () => {
... ... @@ -198,21 +200,24 @@ export class GetuiPush {
if (pushContent && pushContent.isPush) {
Logger.debug(TAG, "接收到推送: " + JSON.stringify(want.parameters))
this.lastPushContent = pushContent
if (this.initialed) {
if (this.initialed && this.hasEnterMain) {
this.comsumeLastPushContent()
} else {
Logger.debug(TAG, "等待初始化完成 或 进入主页")
}
}
}
// 首次进入主页,即可解析跳转推送
onReachMainPage() {
this.hasEnterMain = true
if (this.initialed) {
this.comsumeLastPushContent()
} else {
// 这里可能还没来得及初始化完成。所以不能清空
// this.lastPushContent = undefined
Logger.debug(TAG, "等待初始化完成")
}
this.hasEnterMain = true
}
comsumeLastPushContent() {
... ... @@ -229,6 +234,9 @@ export class GetuiPush {
Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
PushManager.setClickWant(this.lastPushContent.want)
}
} else if (this.lastPushContent.want) {
Logger.debug(TAG, "推送 回执: " + this.lastPushContent.want)
PushManager.setClickWant(this.lastPushContent.want)
}
if (this.lastPushContent.pushLink) {
Logger.debug(TAG, "跳转对应页面: " + this.lastPushContent.pushLink)
... ...