diff --git a/src/platforms/app-plus/service/api/device/soter-authentication.js b/src/platforms/app-plus/service/api/device/soter-authentication.js index d8ea1e95a1181ef8efe895b2e737582296a21ddf..38ba10f87b8779e4d6ddfa64d80ac91e98b84313 100644 --- a/src/platforms/app-plus/service/api/device/soter-authentication.js +++ b/src/platforms/app-plus/service/api/device/soter-authentication.js @@ -130,8 +130,14 @@ export function startSoterAuthentication ({ } const realAuthMode = enrolledRequestAuthMode[0] if (realAuthMode === 'fingerPrint') { + let waiting = null + let waitingTimer + const waitingTitle = + authContent || t('uni.startSoterAuthentication.authContent') if (plus.os.name.toLowerCase() === 'android') { - plus.nativeUI.showWaiting(authContent || t('uni.startSoterAuthentication.authContent')).onclose = function () { + waiting = plus.nativeUI.showWaiting(waitingTitle) + + waiting.onclose = function () { plus.fingerprint.cancel() } } @@ -145,6 +151,13 @@ export function startSoterAuthentication ({ }, (e) => { switch (e.code) { case e.AUTHENTICATE_MISMATCH: + if (waiting) { + clearTimeout(waitingTimer) + waiting.setTitle('无法识别') + waitingTimer = setTimeout(() => { + waiting && waiting.setTitle(waitingTitle) + }, 1000) + } // 微信小程序没有这个回调,如果要实现此处回调需要多次触发需要用事件publish实现 // invoke(callbackId, { // authMode: realAuthMode,