提交 325d8b20 编写于 作者: D DCloud_LXH

fix(app): 指纹识别失败后提示 question/157353

上级 7b180c3d
......@@ -187,10 +187,13 @@ export const startSoterAuthentication =
}
const realAuthMode = enrolledRequestAuthMode[0]
if (realAuthMode === 'fingerPrint') {
let waiting: PlusNativeUIWaitingObj | null = null
let waitingTimer: ReturnType<typeof setTimeout>
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()
}
}
......@@ -208,6 +211,13 @@ export const startSoterAuthentication =
}
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,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册