From b5720232bd7009ad10b3786d2a3208cefd86c3b0 Mon Sep 17 00:00:00 2001 From: sizhenzhen Date: Fri, 12 Sep 2025 14:41:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: sizhenzhen --- entry/src/main/ets/pages/Index.ets | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index 176c3f5..d2ee708 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -138,6 +138,18 @@ struct Index { this.authType.includes(userAuth.UserAuthType.FINGERPRINT) && this.isFingerprintLocked } + handleCmdDataObjItems(cmdDataObj: WidgetCommand): void { + cmdDataObj.cmd?.map((item) => { + if (item.payload?.lockoutDuration !== 0 && item.payload?.remainAttempts === 0) { + if (item.payload?.type === 'face') { + this.isFaceLocked = true; + } else if (item.payload?.type === 'fingerprint') { + this.isFingerprintLocked = true; + } + } + }) + } + handleLocked(): boolean { if (this.skipLockedBiometricAuth) { if (this.isFaceLockedFn()) { @@ -166,15 +178,7 @@ struct Index { LogUtils.info(TAG, 'sendCommand result: ' + result); const cmdDataObj: WidgetCommand = JSON.parse(result || '{}'); this.skipLockedBiometricAuth = cmdDataObj?.skipLockedBiometricAuth ?? false - cmdDataObj.cmd?.map((item) => { - if (item.payload?.lockoutDuration !== 0 && item.payload?.remainAttempts === 0) { - if (item.payload?.type === 'face') { - this.isFaceLocked = true; - } else if (item.payload?.type === 'fingerprint') { - this.isFingerprintLocked = true; - } - } - }) + this.handleCmdDataObjItems(cmdDataObj); if (this.handleLocked()) { return; }