未验证 提交 a5079303 编写于 作者: O openharmony_ci 提交者: Gitee

!22753 fix:ArkTs适配

Merge pull request !22753 from YanPei/master
......@@ -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.
先完成此消息的编辑!
想要评论请 注册