提交 b12c8b79 编写于 作者: Y ywx1057076 提交者: YanPei
上级 1cc00ec7
......@@ -33,11 +33,11 @@ querySystemCapabilities(callback: AsyncCallback<string>): void;
```ts
try {
systemcapability.querySystemCapabilities(function (err, data) {
systemcapability.querySystemCapabilities((err:Error, data:string) => {
if (err == undefined) {
console.log("get system capabilities:" + data)
} else {
console.log(" get system capabilities err:" + err.code)
console.log(" get system capabilities err:" + err)
}});
}catch(e){
console.log("get unexpected error: " + e);
......@@ -63,11 +63,10 @@ querySystemCapabilities(): Promise<string>
```ts
try {
var p = systemcapability.querySystemCapabilities();
p.then(function (value) {
systemcapability.querySystemCapabilities().then((value:string) => {
console.log("get system capabilities: " + value);
}).catch(function (err) {
console.log("get system capabilities error: " + err.code);
}).catch((err:Error) => {
console.log("get system capabilities error: " + err);
});
}catch(e){
console.log("get unexpected error: " + e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册