更新记录
1.0.1(2026-01-07)
新增功能
- 无
问题修复
- 修复低版本的自定义基座问题
功能优化
- 改成kotlin的写法
1.0.0(2025-06-05)
新增功能
- 新增了
checkAuth,authLogin方法 - 初始版本
问题修复
- 无
功能优化
- 无
平台兼容性
uni-app(4.76)
| Vue2 | Vue2插件版本 | Vue3 | Vue2插件版本 | Chrome | Safari | app-vue | app-vue插件版本 | app-nvue | app-nvue插件版本 | Android | Android插件版本 | iOS | 鸿蒙 | 鸿蒙插件版本 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| √ | 1.0.0 | √ | 1.0.0 | × | × | √ | 1.0.0 | √ | 1.0.0 | 6.0 | 1.0.0 | × | 5.0以下(不包括5.0) | 1.0.0 |
| 微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 小红书小程序 | 快应用-华为 | 快应用-联盟 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| × | × | × | × | × | × | - | × | × | - | × | × |
uni-app x(4.76)
| Chrome | Safari | Android | Android插件版本 | iOS | 鸿蒙 | 鸿蒙插件版本 | 微信小程序 |
|---|---|---|---|---|---|---|---|
| × | × | 6.0 | 1.0.0 | × | 5.0以下(不包括5.0) | 1.0.0 | × |
其他
| 多语言 | 暗黑模式 | 宽屏模式 |
|---|---|---|
| × | × | √ |
生物认证识别,支持人脸识别、指纹识别,用于用户登录 、支付、解锁认证等(ima-auth)
ima-auth是一款生物认证识别的UTS插件,支持检测支持哪些生物识别、认证识别等功能,主要应用于人脸、指纹进行登录、支付、解锁认证等授权,使用手机本身自带的人脸、指纹进行识别,进而判断是否机主本人,从而进行授权验证
⚠️注意️
android 端已全部完成代码的开发与测试(已完成)harmony 端(计划中)
需要权限
- 文件读取、文件写入
"android.permission.USE_BIOMETRIC"
"android.permission.USE_FACE"
"android.permission.CAMERA"
"android.permission.USE_FINGERPRINT"
- 即:在
manifest.json中的distribute.android.permissions加入
// 生物识别
<uses-permission android:name="android.permission.USE_BIOMETRIC" />
// 人脸识别
<uses-permission android:name="android.permission.USE_FACE" />
// 相机(人脸识别)
<uses-permission android:name="android.permission.CAMERA" />
// 指纹识别
<uses-permission android:name="android.permission.USE_FINGERPRINT" />
使用示例【此示例只实现了所有的功能逻辑】
- 新建一个
test.vue的文件
<template>
<view class="content">
<!-- 生物识别登录 -->
<view class="content-title">生物识别登录</view>
<view class="content-message">(生物识别登录包括人脸、指纹,⚠️注意:部分国内安卓厂商禁止使用人脸认证,只能调起指纹识别)</view>
<view class="content-button auto-login" @click="onCheck">检测支持性</view>
<view class="content-button auto-login" @click="onStartAuth('biometric')">人脸&指纹识别(biometric)</view>
<view class="content-button auto-login" @click="onStartAuth('face')">人脸识别(face)</view>
<view class="content-button auto-login" @click="onStartAuth('finger')">指纹识别(finger)</view>
</view>
</template>
<script lang="ts">
import { checkAuth, authLogin } from "@/uni_modules/ima-auth"
export default {
data() {
return {}
},
onLoad() { },
methods: {
// 检测支持性
onCheck() {
checkAuth((res : any) => {
console.log('检测支持性', res)
});
},
// 开始识别操作
onStartAuth(type : String) {
console.log('开始识别操作:', type)
authLogin(type, (res : any) => {
console.log('登录结果', res)
})
}
}
}
</script>
<style lang="scss">
.content {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
&-title {
margin-top: 10rpx;
padding: 10rpx;
font-size: 44rpx;
font-weight: 800;
color: #ff0000;
}
&-message {
font-size: 28rpx;
font-weight: 800;
text-align: center;
color: #ff6700;
}
&-button {
height: 65rpx;
width: 750rpx;
padding: 20rpx;
line-height: 65rpx;
text-align: center;
background: #00e0f1;
margin-bottom: 25rpx;
}
}
</style>
方法
| 方法名称 | 说明 | 方法参数 | 平台 |
|---|---|---|---|
| checkAuth | 检测支持哪些生物识别 | 无 | android |
| authLogin | 认证识别 | type : AuthType,要认证的类型,callback:回调函数 | android |

收藏人数:
购买源码授权版(
试用
使用 HBuilderX 导入示例项目
赞赏(0)
下载 523
赞赏 1
下载 13648025
赞赏 1851
赞赏
京公网安备:11010802035340号