登录和接口请求
This commit is contained in:
@@ -26,12 +26,11 @@ import { KitLogger } from './logger/AppLogger';
|
||||
import { LoggerKitImpl } from './logger/LoggerKitImpl';
|
||||
import { ChatRepo } from './repo/ChatRepo';
|
||||
import { saveLocalRevokeMessageFormOther } from './utils/MessageUtils';
|
||||
import { router } from '@kit.ArkUI';
|
||||
import { LengthMetrics, router } from '@kit.ArkUI';
|
||||
import { HMRouterMgr } from '@hadss/hmrouter';
|
||||
import { NotificationUtil } from '@itcast/basic';
|
||||
import { ChangeUtil, NotificationUtil } from '@itcast/basic';
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { NotificationBasicOptions } from '@itcast/basic/src/main/ets/pushnotification/NotificationOptions';
|
||||
|
||||
export const currentConversationChanged: string = 'CurrentConversationChanged'
|
||||
|
||||
export class ChatKitClient {
|
||||
@@ -58,6 +57,7 @@ export class ChatKitClient {
|
||||
appKey: appKey,
|
||||
imVersion: IM_SDK_VERSION,
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,13 +175,33 @@ export class ChatKitClient {
|
||||
console.info("netease ChatKitClient initListener ");
|
||||
ChatKitClient.nim.loginService.on("onKickedOffline", (detail: V2NIMKickedOfflineDetail) => {
|
||||
// const detail = ChatKitClient.nim.loginService.getKickedOfflineDetail()
|
||||
console.log('Response onKickedOffline'+detail.clientType+' 22 '+detail.customClientType)
|
||||
// console.log('Response onKickedOffline'+detail.clientType+' 22 '+detail.customClientType)
|
||||
if(HMRouterMgr.getCurrentPathStack()!=null)
|
||||
{
|
||||
HMRouterMgr.removeAll()
|
||||
}
|
||||
let phone="ios";
|
||||
switch(detail.clientType)
|
||||
{
|
||||
case 1:
|
||||
phone="android";
|
||||
break;
|
||||
case 2:
|
||||
phone="ios";
|
||||
break;
|
||||
case 16:
|
||||
phone="web";
|
||||
break;
|
||||
default:
|
||||
phone="其他设备";
|
||||
break;
|
||||
|
||||
HMRouterMgr.removeAll()
|
||||
router.replaceUrl({
|
||||
url: 'pages/LoginPage/LoginPage', // 目标url
|
||||
},router.RouterMode.Single)
|
||||
router.clear()
|
||||
}
|
||||
ChangeUtil.Logout(phone)
|
||||
// router.replaceUrl({
|
||||
// url: 'pages/LoginPage/LoginPage', // 目标url
|
||||
// },router.RouterMode.Single)
|
||||
// router.clear()
|
||||
})
|
||||
// 数据同步监听
|
||||
ChatKitClient.nim.conversationService?.on('onSyncFinished', ChatKitClient.onSyncFinishedFun)
|
||||
@@ -223,4 +243,6 @@ export class ChatKitClient {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user