未验证 提交 25185e0e 编写于 作者: O openharmony_ci 提交者: Gitee

!9873 更新userAuth和faceAuth的文档资料

Merge pull request !9873 from youliang_1314/master
...@@ -37,36 +37,38 @@ constructor() ...@@ -37,36 +37,38 @@ constructor()
```js ```js
import userIAM_faceAuth from '@ohos.userIAM.faceAuth'; import userIAM_faceAuth from '@ohos.userIAM.faceAuth';
let faceAuthManager = new userIAM_faceAuth.FaceAuthManager() let faceAuthManager = new userIAM_faceAuth.FaceAuthManager();
``` ```
### setSurfaceId ### setSurfaceId
setSurfaceId(surfaceId: string): ResultCode; setSurfaceId(surfaceId: string): void;
设置录入流程中人脸预览界面 [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) 持有 Surface 的 ID, 返回值表示操作是否成功 设置录入流程中人脸预览界面 [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) 持有 Surface 的 ID。
**系统能力:** SystemCapability.UserIAM.UserAuth.FaceAuth **系统能力:** SystemCapability.UserIAM.UserAuth.FaceAuth
**需要权限:** ohos.permission.MANAGE_USER_IDM
**参数:** **参数:**
| 参数名 | 类型 | 必填 | 说明 | | 参数名 | 类型 | 必填 | 说明 |
| -------------- | ---------------------------------- | ---- | -------------------------- | | -------------- | ---------------------------------- | ---- | -------------------------- |
| surfaceId | string | 是 | [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) 持有 Surface 的 ID。 | | surfaceId | string | 是 | [XComponent](../arkui-ts/ts-basic-components-xcomponent.md#getxcomponentsurfaceid) 持有 Surface 的 ID。 |
**返回值:**
| 类型 | 说明 |
| ---------- | ------------------------------------------------------------ |
| [ResultCode](#resultcode) | 表示操作是否成功 |
**示例:** **示例:**
```js ```js
import userIAM_faceAuth from '@ohos.userIAM.faceAuth'; import faceAuth from '@ohos.userIAM.faceAuth';
let faceAuthManager = new userIAM_faceAuth.FaceAuthManager() let surfaceId = "123456";
faceAuthManager.setSurfaceId("0"); let manager = new faceAuth.FaceAuthManager();
try {
manager.setSurfaceId(surfaceId);
console.info("set surface id success");
} catch (e) {
console.error("set surface id failed, error = " + e);
}
``` ```
## ResultCode ## ResultCode
...@@ -77,5 +79,4 @@ setSurfaceId(surfaceId: string): ResultCode; ...@@ -77,5 +79,4 @@ setSurfaceId(surfaceId: string): ResultCode;
| 名称 | 默认值 | 描述 | | 名称 | 默认值 | 描述 |
| ----------------------- | ------ | -------------------- | | ----------------------- | ------ | -------------------- |
| SUCCESS | 0 | 执行成功。 | | FAIL | 12700001 | 执行失败。 |
| FAIL | 1 | 执行失败。 |
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册