fix |> 【8.0新需求】设备拉黑功能未实现;
http://192.168.1.3:8080/zentao/bug-view-19542.html Signed-off-by: xugenyuan <xugenyuan@wondertek.com.cn>
Showing
3 changed files
with
13 additions
and
3 deletions
| @@ -14,6 +14,9 @@ export class AppUtils { | @@ -14,6 +14,9 @@ export class AppUtils { | ||
| 14 | AppUtils.buildVersion = BuildProfile.BUILD_VERSION; | 14 | AppUtils.buildVersion = BuildProfile.BUILD_VERSION; |
| 15 | } | 15 | } |
| 16 | 16 | ||
| 17 | + // 全局应用context | ||
| 18 | + public static gotApplicationContextFunc?: () => common.UIAbilityContext | ||
| 19 | + | ||
| 17 | /** | 20 | /** |
| 18 | * 获取应用名称 | 21 | * 获取应用名称 |
| 19 | * 即:人民日报 | 22 | * 即:人民日报 |
| 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' | 1 | import { Logger } from 'wdKit/src/main/ets/utils/Logger' |
| 2 | import { LoginModel } from './LoginModel' | 2 | import { LoginModel } from './LoginModel' |
| 3 | import { LoginBean } from './LoginBean' | 3 | import { LoginBean } from './LoginBean' |
| 4 | -import { EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' | 4 | +import { AppUtils, EmitterEventId, EmitterUtils, SPHelper, StringUtils, UserDataLocal } from 'wdKit' |
| 5 | import { CheckVerifyBean } from './CheckVerifyBean' | 5 | import { CheckVerifyBean } from './CheckVerifyBean' |
| 6 | import cryptoFramework from '@ohos.security.cryptoFramework' | 6 | import cryptoFramework from '@ohos.security.cryptoFramework' |
| 7 | import buffer from '@ohos.buffer' | 7 | import buffer from '@ohos.buffer' |
| @@ -105,7 +105,7 @@ export class LoginViewModel { | @@ -105,7 +105,7 @@ export class LoginViewModel { | ||
| 105 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "") | 105 | SPHelper.default.saveSync(SpConstants.USER_NAME, data.userName ?? "") |
| 106 | EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) | 106 | EmitterUtils.sendEmptyEvent(EmitterEventId.LOGIN_SUCCESS) |
| 107 | 107 | ||
| 108 | - LoginModule.reportDeviceInfo() | 108 | + LoginModule.reportDeviceInfo(AppUtils.gotApplicationContextFunc!()) |
| 109 | } | 109 | } |
| 110 | 110 | ||
| 111 | async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { | 111 | async appLoginByPassword(phone: string, loginType: number, password: string, oldPassword: string) { |
| 1 | import { AbilityConstant, common, Want } from '@kit.AbilityKit' | 1 | import { AbilityConstant, common, Want } from '@kit.AbilityKit' |
| 2 | -import { DeviceUtil, | 2 | +import { |
| 3 | + AppUtils, | ||
| 4 | + DeviceUtil, | ||
| 3 | EmitterEventId, | 5 | EmitterEventId, |
| 4 | EmitterUtils, | 6 | EmitterUtils, |
| 5 | KVStoreHelper, | 7 | KVStoreHelper, |
| @@ -58,6 +60,11 @@ export class StartupManager { | @@ -58,6 +60,11 @@ export class StartupManager { | ||
| 58 | // 路由注册 | 60 | // 路由注册 |
| 59 | registerRouter(); | 61 | registerRouter(); |
| 60 | 62 | ||
| 63 | + // 设置全局context | ||
| 64 | + AppUtils.gotApplicationContextFunc = () => { | ||
| 65 | + return this.context! | ||
| 66 | + } | ||
| 67 | + | ||
| 61 | // 网络模块 | 68 | // 网络模块 |
| 62 | NetworkManager.getInstance().init() | 69 | NetworkManager.getInstance().init() |
| 63 | 70 |
-
Please register or login to post a comment