From 1bbb3b7b062852830d30634a7c324e24235c13a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=87=E6=AC=A3?= Date: Fri, 10 Mar 2023 03:42:19 +0000 Subject: [PATCH] fixed 975f9e7 from https://gitee.com/wanxinhuawei/docs/pulls/15830 update zh-cn/application-dev/reference/apis/js-apis-system-device.md. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 万欣 --- .../reference/apis/js-apis-system-device.md | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-system-device.md b/zh-cn/application-dev/reference/apis/js-apis-system-device.md index 540604926e..a27e11dd0d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-system-device.md +++ b/zh-cn/application-dev/reference/apis/js-apis-system-device.md @@ -15,7 +15,7 @@ import device from '@system.device'; ## device.getInfo -getInfo(Object): void +getInfo(options?: GetDeviceOptions): void 获取当前设备的信息。 @@ -28,13 +28,27 @@ getInfo(Object): void | 参数名 | 类型 | 必填 | 说明 | | -------- | -------- | -------- | -------- | -| success | Function | 否 | 接口调用成功的回调函数。 | -| fail | Function | 否 | 接口调用失败的回调函数。 | -| complete | Function | 否 | 接口调用结束的回调函数。 | +| options | [GetDeviceOptions](#getdeviceoptions) | 否 | 定义设备信息获取的参数选项。 | -success返回值: +## GetDeviceOptions -| 参数名 | 类型 | 说明 | +定义设备信息获取的参数选项。 + +**系统能力: ** SystemCapability.Startup.SystemInfo + +| 名称 | 类型 | 必填 | 说明 | +| -------- | -------- | -------- | -------- | +| success | (data:DeviceResponse)=> void | 否 | 接口调用成功的回调函数。 data为成功返回的设备信息,具体参考[DeviceResponse]。| +| fail | (data:any,code:number)=> void | 否 | 接口调用失败的回调函数。 code为失败返回的错误码。
code:200,表示返回结果中存在无法获得的信息。| +| complete | ()=> void | 否 | 接口调用结束的回调函数。 | + +## DeviceResponse + +设备信息。 + +##系统能力:** SystemCapability.Startup.SystemInfo + +| 名称 | 类型 | 说明 | | -------- | -------- | -------- | | brand | string | 品牌。 | | manufacturer | string | 生产商。 | @@ -50,11 +64,6 @@ success返回值: | releaseType4+ | string | 版本发布类型,值为类型+版本号,如Beta1。
类型可能值有:
- Canary:同一apiVersion下,canary版本之间保持API兼容,beta版本不对canary版本兼容。
- Beta:同一apiVersion下,beta版本之间保持API兼容,release版本不对beta版本兼容。
- Release:release版本会保持5个API版本兼容。 | | deviceType4+ | string | 设备类型。 | -fail返回错误代码: - -| 错误码 | 说明 | -| -------- | -------- | -| 200 | 返回结果中存在无法获得的信息。 | **示例:** -- GitLab