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 540604926ed2d7cc96cad11b6eda81ee7708a3f3..a27e11dd0defccef2c523fb6271c9cbb53a3d49d 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 | 返回结果中存在无法获得的信息。 | **示例:**