Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
101c481f
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
101c481f
编写于
5月 16, 2023
作者:
W
wangxuanxuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify DM API description
Signed-off-by:
N
wangxuanxuan
<
wangxuanxuan9@huawei.com
>
上级
19eb0d19
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
10 addition
and
6 deletion
+10
-6
zh-cn/application-dev/reference/apis/js-apis-device-manager.md
.../application-dev/reference/apis/js-apis-device-manager.md
+10
-6
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-device-manager.md
浏览文件 @
101c481f
...
...
@@ -487,6 +487,8 @@ getDeviceInfo(networkId: string, callback:AsyncCallback<DeviceInfo>): void
```
js
try
{
// 设备网络标识,可以从可信设备列表中获取
let
networkId
=
"
xxxxxxx
"
dmInstance
.
getDeviceInfo
(
networkId
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
error
(
"
getDeviceInfo errCode:
"
+
err
.
code
+
"
,errMessage:
"
+
err
.
message
);
...
...
@@ -530,6 +532,8 @@ getDeviceInfo(networkId: string): Promise<DeviceInfo>
**示例:**
```
js
// 设备网络标识,可以从可信设备列表中获取
let
networkId
=
"
xxxxxxx
"
dmInstance
.
getDeviceInfo
(
networkId
).
then
((
data
)
=>
{
console
.
log
(
'
get device info:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
...
...
@@ -944,11 +948,11 @@ requestCredentialRegisterInfo(requestInfo: string, callback: AsyncCallback<{regi
"
userId
"
:
"
123
"
}
try
{
dm
Class
.
requestCredentialRegisterInfo
(
credentialInfo
,
(
data
)
=>
{
dm
Instance
.
requestCredentialRegisterInfo
(
credentialInfo
,
(
data
)
=>
{
if
(
data
)
{
console
.
info
(
"
requestCredentialRegisterInfo result:
"
+
JSON
.
stringify
(
data
));
}
else
{
console
.
info
.
push
(
"
requestCredentialRegisterInfo result: data is null
"
);
console
.
info
(
"
requestCredentialRegisterInfo result: data is null
"
);
}
});
}
catch
(
err
)
{
...
...
@@ -995,11 +999,11 @@ importCredential(credentialInfo: string, callback: AsyncCallback<{resultInfo: st
]
}
try
{
dm
Class
.
importCredential
(
credentialInfo
,
(
data
)
=>
{
dm
Instance
.
importCredential
(
credentialInfo
,
(
data
)
=>
{
if
(
data
)
{
console
.
info
(
"
importCredential result:
"
+
JSON
.
stringify
(
data
));
}
else
{
console
.
info
.
push
(
"
importCredential result: data is null
"
);
console
.
info
(
"
importCredential result: data is null
"
);
}
});
}
catch
(
err
)
{
...
...
@@ -1031,11 +1035,11 @@ deleteCredential(queryInfo: string, callback: AsyncCallback<{resultInfo: string}
"
userId
"
:
"
123
"
}
try
{
dm
Class
.
deleteCredential
(
queryInfo
,
(
data
)
=>
{
dm
Instance
.
deleteCredential
(
queryInfo
,
(
data
)
=>
{
if
(
data
)
{
console
.
info
(
"
deleteCredential result:
"
+
JSON
.
stringify
(
data
));
}
else
{
console
.
info
.
push
(
"
deleteCredential result: data is null
"
);
console
.
info
(
"
deleteCredential result: data is null
"
);
}
});
}
catch
(
err
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录