xugenyuan

ref |> 增加设备拉黑

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
... ... @@ -6,6 +6,7 @@ import { AccountManagerUtils, SPHelper } from 'wdKit/Index'
import { LoginViewModel } from './pages/login/LoginViewModel'
import { SpConstants } from 'wdConstant/Index'
import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo'
import { common } from '@kit.AbilityKit'
class LoginJumpHandler implements JumpInterceptorAction {
... ... @@ -42,12 +43,17 @@ export class LoginModule {
}
// 启动进入主页 和 每次登录成功调用
static reportDeviceInfo() {
static reportDeviceInfo(context?: common.UIAbilityContext) {
ReportDeviceInfo.reportDeviceInfo().then((res) => {
let nickName = res.touristNickName
if (res.touristNickName) {
SPHelper.default.save(SpConstants.TOURIST_NICK_NAME, res.touristNickName)
}
if (res.blockStatus == -2) {
// Exit the application.
context?.terminateSelf();
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -38,4 +38,5 @@ export class ReportDeviceInfo {
export class ReportDeviceInfoRes {
clean : number = 0
touristNickName : string = ""
blockStatus: number = 0 // 当等于-2时,表示拉黑
}
\ No newline at end of file
... ...
... ... @@ -137,7 +137,7 @@ export class StartupManager {
return new Promise((resolve) => {
Logger.debug(TAG, "App 初次进入首页,开始其他任务初始化")
LoginModule.reportDeviceInfo()
LoginModule.reportDeviceInfo(this.context)
GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => {
HWLocationUtils.startLocationService()
... ...