Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
DCloud
uni-app
提交
73382263
U
uni-app
项目概览
DCloud
/
uni-app
14 天 前同步成功
通知
751
Star
38709
Fork
3642
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
8
列表
看板
标记
里程碑
合并请求
1
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
8
Issue
8
列表
看板
标记
里程碑
合并请求
1
合并请求
1
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
73382263
编写于
11月 18, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: build
上级
71303a99
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
72 addition
and
89 deletion
+72
-89
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+72
-89
未找到文件。
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
73382263
...
...
@@ -11533,7 +11533,7 @@ const API_GET_SCREEN_BRIGHTNESS = 'getScreenBrightness';
const API_SET_SCREEN_BRIGHTNESS = 'setScreenBrightness';
const API_SET_KEEP_SCREEN_ON = 'setKeepScreenOn';
const API_CHECK_IS_SUPPORT_SOTER_AUTHENTICATION = '
s
oterAuthentication';
const API_CHECK_IS_SUPPORT_SOTER_AUTHENTICATION = '
checkIsSupportS
oterAuthentication';
const API_CHECK_IS_SOTER_ENROLLED_IN_DEVICE = 'checkIsSoterEnrolledInDevice';
const CheckAuthModes = [
'fingerPrint',
...
...
@@ -11551,7 +11551,7 @@ const CheckIsSoterEnrolledInDeviceOptions = {
const CheckIsSoterEnrolledInDeviceProtocols = {
checkAuthMode: String,
};
const API_START_SOTER_AUTHENTICATION = '
checkIsSoterEnrolledInDevice
';
const API_START_SOTER_AUTHENTICATION = '
startSoterAuthentication
';
const StartSoterAuthenticationOptions = {
formatArgs: {
requestAuthModes(value, params) {
...
...
@@ -14141,29 +14141,27 @@ const startSoterAuthentication = defineAsyncApi(API_START_SOTER_AUTHENTICATION,
*/
initI18nStartSoterAuthenticationMsgsOnce();
const { t } = useI18n();
const
supportMode = baseCheckIsSupportSoterAuthentication().supportMode
;
if (
supportMode.length === 0
) {
return {
const
{ supportMode } = baseCheckIsSupportSoterAuthentication()
;
if (
!supportMode.length
) {
return
reject('not support',
{
authMode: 'fingerPrint',
errCode: 90001,
errMsg: 'startSoterAuthentication:fail',
};
});
}
const supportRequestAuthMode = [];
requestAuthModes.
map((item, index
) => {
requestAuthModes.
forEach((item
) => {
if (supportMode.indexOf(item) > -1) {
supportRequestAuthMode.push(item);
}
});
if (
supportRequestAuthMode.length === 0
) {
return {
if (
!supportRequestAuthMode.length
) {
return
reject('startSoterAuthentication:fail no corresponding mode',
{
authMode: 'fingerPrint',
errCode: 90003,
errMsg: 'startSoterAuthentication:fail no corresponding mode',
};
});
}
const enrolledRequestAuthMode = [];
supportRequestAuthMode.
map((item, index
) => {
supportRequestAuthMode.
forEach((item
) => {
const checked = basecheckIsSoterEnrolledInDevice({
checkAuthMode: item,
}).isEnrolled;
...
...
@@ -14171,20 +14169,69 @@ const startSoterAuthentication = defineAsyncApi(API_START_SOTER_AUTHENTICATION,
enrolledRequestAuthMode.push(item);
}
});
if (
enrolledRequestAuthMode.length === 0
) {
return {
if (
!enrolledRequestAuthMode.length
) {
return
reject(`startSoterAuthentication:fail no ${supportRequestAuthMode[0]} enrolled`,
{
authMode: supportRequestAuthMode[0],
errCode: 90011,
errMsg: `startSoterAuthentication:fail no ${supportRequestAuthMode[0]} enrolled`,
};
});
}
const realAuthMode = enrolledRequestAuthMode[0];
let waiting = null;
let waitingTimer;
const authenticateMessage = authContent || t('uni.startSoterAuthentication.authContent');
const errorCB = (err) => {
const { code } = err;
const res = {
authMode: realAuthMode,
};
const handler = {
// AUTHENTICATE_MISMATCH
4: () => {
if (waiting) {
clearTimeout(waitingTimer);
waiting.setTitle('无法识别');
waitingTimer = setTimeout(() => {
waiting && waiting.setTitle(authenticateMessage);
}, 1000);
}
else {
reject('', extend(res, {
errCode: 90009,
}));
}
},
// AUTHENTICATE_OVERLIMIT
5: () => {
// 微信小程序在第一次重试次数超限时安卓IOS返回不一致
// 安卓端会返回次数超过限制(errCode: 90010)
// IOS端会返回认证失败(errCode: 90009)
// APP-IOS实际运行时不会次数超限,超过指定次数之后会弹出输入密码的界面
plus.nativeUI.closeWaiting();
reject('authenticate freeze. please try again later', extend(res, {
errCode: 90010,
}));
},
// CANCEL
6: () => {
plus.nativeUI.closeWaiting();
reject('cancel', extend(res, {
errCode: 90008,
}));
},
};
if (code && handler[code]) {
handler[code]();
}
else {
plus.nativeUI.closeWaiting();
reject('', extend(res, {
errCode: 90007,
}));
}
};
if (realAuthMode === 'fingerPrint') {
let waiting = null;
let waitingTimer;
const waitingTitle = authContent || t('uni.startSoterAuthentication.authContent');
if (plus.os.name.toLowerCase() === 'android') {
waiting = plus.nativeUI.showWaiting(
waitingTitl
e);
waiting = plus.nativeUI.showWaiting(
authenticateMessag
e);
waiting.onclose = function () {
plus.fingerprint.cancel();
};
...
...
@@ -14195,58 +14242,15 @@ const startSoterAuthentication = defineAsyncApi(API_START_SOTER_AUTHENTICATION,
authMode: realAuthMode,
errCode: 0,
});
}, (e) => {
const res = {
authMode: realAuthMode,
};
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,
// errCode: 90009,
// errMsg: 'startSoterAuthentication:fail'
// })
break;
case e.AUTHENTICATE_OVERLIMIT:
// 微信小程序在第一次重试次数超限时安卓IOS返回不一致,安卓端会返回次数超过限制(errCode: 90010),IOS端会返回认证失败(errCode: 90009)。APP-IOS实际运行时不会次数超限,超过指定次数之后会弹出输入密码的界面
plus.nativeUI.closeWaiting();
reject('authenticate freeze. please try again later', extend(res, {
errCode: 90010,
}));
break;
case e.CANCEL:
plus.nativeUI.closeWaiting();
reject('cancel', extend(res, {
errCode: 90008,
}));
break;
default:
plus.nativeUI.closeWaiting();
reject('', extend(res, {
errCode: 90007,
}));
break;
}
}, {
message: authContent,
}, errorCB, {
message: authenticateMessage,
});
}
else if (realAuthMode === 'facial') {
const faceID = requireNativePlugin('faceID');
faceID.authenticate({
message: auth
Content
,
message: auth
enticateMessage
,
}, (e) => {
const res = {
authMode: realAuthMode,
};
if (e.type === 'success' && e.code === 0) {
resolve({
authMode: realAuthMode,
...
...
@@ -14254,28 +14258,7 @@ const startSoterAuthentication = defineAsyncApi(API_START_SOTER_AUTHENTICATION,
});
}
else {
switch (e.code) {
case 4:
reject('', extend(res, {
errCode: 90009,
}));
break;
case 5:
reject('authenticate freeze. please try again later', extend(res, {
errCode: 90010,
}));
break;
case 6:
reject('', extend(res, {
errCode: 90008,
}));
break;
default:
reject('', extend(res, {
errCode: 90007,
}));
break;
}
errorCB(e);
}
});
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录