xugenyuan

ref |> 增加设备拉黑

Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
@@ -6,6 +6,7 @@ import { AccountManagerUtils, SPHelper } from 'wdKit/Index' @@ -6,6 +6,7 @@ import { AccountManagerUtils, SPHelper } from 'wdKit/Index'
6 import { LoginViewModel } from './pages/login/LoginViewModel' 6 import { LoginViewModel } from './pages/login/LoginViewModel'
7 import { SpConstants } from 'wdConstant/Index' 7 import { SpConstants } from 'wdConstant/Index'
8 import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo' 8 import { ReportDeviceInfo } from './reportDeviceInfo/ReportDeviceInfo'
  9 +import { common } from '@kit.AbilityKit'
9 10
10 class LoginJumpHandler implements JumpInterceptorAction { 11 class LoginJumpHandler implements JumpInterceptorAction {
11 12
@@ -42,12 +43,17 @@ export class LoginModule { @@ -42,12 +43,17 @@ export class LoginModule {
42 } 43 }
43 44
44 // 启动进入主页 和 每次登录成功调用 45 // 启动进入主页 和 每次登录成功调用
45 - static reportDeviceInfo() { 46 + static reportDeviceInfo(context?: common.UIAbilityContext) {
46 ReportDeviceInfo.reportDeviceInfo().then((res) => { 47 ReportDeviceInfo.reportDeviceInfo().then((res) => {
47 let nickName = res.touristNickName 48 let nickName = res.touristNickName
48 if (res.touristNickName) { 49 if (res.touristNickName) {
49 SPHelper.default.save(SpConstants.TOURIST_NICK_NAME, res.touristNickName) 50 SPHelper.default.save(SpConstants.TOURIST_NICK_NAME, res.touristNickName)
50 } 51 }
  52 +
  53 + if (res.blockStatus == -2) {
  54 + // Exit the application.
  55 + context?.terminateSelf();
  56 + }
51 }) 57 })
52 } 58 }
53 } 59 }
@@ -38,4 +38,5 @@ export class ReportDeviceInfo { @@ -38,4 +38,5 @@ export class ReportDeviceInfo {
38 export class ReportDeviceInfoRes { 38 export class ReportDeviceInfoRes {
39 clean : number = 0 39 clean : number = 0
40 touristNickName : string = "" 40 touristNickName : string = ""
  41 + blockStatus: number = 0 // 当等于-2时,表示拉黑
41 } 42 }
@@ -137,7 +137,7 @@ export class StartupManager { @@ -137,7 +137,7 @@ export class StartupManager {
137 return new Promise((resolve) => { 137 return new Promise((resolve) => {
138 Logger.debug(TAG, "App 初次进入首页,开始其他任务初始化") 138 Logger.debug(TAG, "App 初次进入首页,开始其他任务初始化")
139 139
140 - LoginModule.reportDeviceInfo() 140 + LoginModule.reportDeviceInfo(this.context)
141 141
142 GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => { 142 GetuiPush.sharedInstance().requestEnableNotifications(this.context!).then((enabled) => {
143 HWLocationUtils.startLocationService() 143 HWLocationUtils.startLocationService()