You need to sign in or sign up before continuing.
提交 99172902 编写于 作者: Y ywx1057076

fix:ArkTs适配

Signed-off-by: Nywx1057076 <yanpei12@huawei.com>
上级 5e80b054
...@@ -33,11 +33,11 @@ querySystemCapabilities(callback: AsyncCallback&lt;string&gt;): void; ...@@ -33,11 +33,11 @@ querySystemCapabilities(callback: AsyncCallback&lt;string&gt;): void;
```ts ```ts
try { try {
systemcapability.querySystemCapabilities(function (err, data) { systemcapability.querySystemCapabilities((err:Error, data:string) => {
if (err == undefined) { if (err == undefined) {
console.log("get system capabilities:" + data) console.log("get system capabilities:" + data)
} else { } else {
console.log(" get system capabilities err:" + err.code) console.log(" get system capabilities err:" + err)
}}); }});
}catch(e){ }catch(e){
console.log("get unexpected error: " + e); console.log("get unexpected error: " + e);
...@@ -63,11 +63,10 @@ querySystemCapabilities(): Promise&lt;string&gt; ...@@ -63,11 +63,10 @@ querySystemCapabilities(): Promise&lt;string&gt;
```ts ```ts
try { try {
var p = systemcapability.querySystemCapabilities(); systemcapability.querySystemCapabilities().then((value:string) => {
p.then(function (value) {
console.log("get system capabilities: " + value); console.log("get system capabilities: " + value);
}).catch(function (err) { }).catch((err:Error) => {
console.log("get system capabilities error: " + err.code); console.log("get system capabilities error: " + err);
}); });
}catch(e){ }catch(e){
console.log("get unexpected error: " + e); console.log("get unexpected error: " + e);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册