From 837419a4ab6d67b269c919eba37b8862002e20a6 Mon Sep 17 00:00:00 2001 From: zha wei Date: Wed, 7 Jun 2023 11:32:04 +0800 Subject: [PATCH] =?UTF-8?q?description:=E8=AF=B4=E6=98=8E=E6=96=87?= =?UTF-8?q?=E6=A1=A3=E6=A0=BC=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zha wei --- .../reference/apis/js-apis-secureElement.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/zh-cn/application-dev/reference/apis/js-apis-secureElement.md b/zh-cn/application-dev/reference/apis/js-apis-secureElement.md index 5d6aa353ef..4032f01a9d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-secureElement.md +++ b/zh-cn/application-dev/reference/apis/js-apis-secureElement.md @@ -66,9 +66,9 @@ try { this.nfcSEService = secureElement.newSEService("serviceState", (state) => { if (state == secureElement.ServiceState.DISCONNECTED) { - this.result = "Service state is Disconnected"; + this.result = "Service state is Disconnected"; } else { - this.result = "Service state is connected"; + this.result = "Service state is connected"; } }); } catch (e) { @@ -109,11 +109,12 @@ import secureElement from '@ohos.secureElement'; // get SEService try { - this.nfcSEService = secureElement.newSEService("serviceState", (state) => { + this.nfcSEService = secureElement.newSEService("serviceState", (state) => + { if (state == secureElement.ServiceState.DISCONNECTED) { - this.result = "Service state is Disconnected"; + this.result = "Service state is Disconnected"; } else { - this.result = "Service state is connected"; + this.result = "Service state is connected"; } }); } catch (e) { @@ -160,7 +161,7 @@ import secureElement from '@ohos.secureElement'; try { let ret: boolean; - // 有效this.nfcSEService,获取方式参考newService + // 有效this.nfcSEService,获取方式参考newSEService ret = this.nfcSEService.isConnected(); if (ret) { this.result = '获取连接状态:connected'; @@ -202,7 +203,7 @@ import secureElement from '@ohos.secureElement'; @State nfcSEService: secureElement.SEService = null; try { - // 有效this.nfcSEService,获取方式参考newService + // 有效this.nfcSEService,获取方式参考newSEService this.nfcSEService.shutdown(); this.result = "shutdown成功"; } catch (e) { @@ -241,7 +242,7 @@ import secureElement from '@ohos.secureElement'; this.result = "版本名称:" try { - // 有效this.nfcSEService,获取方式参考newService + // 有效this.nfcSEService,获取方式参考newSEService this.result += this.nfcSEService.getVersion(); } catch (e) { this.result += "getVersion异常:" + e.message; @@ -745,12 +746,12 @@ aidArray: number[] = [720, 1080] try { // this.nfcOmaSession:有效的Session,获取方式参考Reader.openSession this.nfcOmaSession.openBasicChannel(this.aidArray, (error, data) => { - if (error) { - this.result = "openBasicChannel2失败:" + JSON.stringify(error); - return; + if (error) { + this.result = "openBasicChannel2失败:" + JSON.stringify(error); + return; } - this.nfcOmaChannel = data; - this.result = "openBasicChannel2获取channel成功"; + this.nfcOmaChannel = data; + this.result = "openBasicChannel2获取channel成功"; }); } catch (e) { this.result = "openBasicChannel2出现异常:" + e.message; @@ -1057,8 +1058,8 @@ if (this.nfcOmaSession) { this.nfcOmaChannel = channel; this.result = "openLogicChannel3获取channel成功"; }).catch((err) => { - this.result = "openLogicChannel3 出现异常"; - }); + this.result = "openLogicChannel3 出现异常"; + }); } catch (e) { this.result = "openLogicChannel3出现异常:" + e.message; } -- GitLab