diff --git a/zh-cn/application-dev/reference/apis/js-apis-net-ethernet.md b/zh-cn/application-dev/reference/apis/js-apis-net-ethernet.md index 50652d0b68fa5e14e732b114c0e718d5a5bacffa..3a80d9cf90063e5b6ef98e24c78bffa6c8e74d2e 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-net-ethernet.md +++ b/zh-cn/application-dev/reference/apis/js-apis-net-ethernet.md @@ -49,9 +49,9 @@ setIfaceConfig(iface: string, ic: InterfaceConfiguration, callback: AsyncCallbac ```js ethernet.setIfaceConfig("eth0", { mode: 0, - ipAddr: "192.168.1.123", - route: "192.168.1.1", - gateway: "192.168.1.1", + ipAddr: "192.168.xx.xxx", + route: "192.168.xx.xxx", + gateway: "192.168.xx.xxx", netMask: "255.255.255.0", dnsServers: "1.1.1.1", domain: "2.2.2.2" @@ -107,9 +107,9 @@ setIfaceConfig(iface: string, ic: InterfaceConfiguration): Promise\ ```js ethernet.setIfaceConfig("eth0", { mode: 0, - ipAddr: "192.168.1.123", - route: "192.168.1.1", - gateway: "192.168.1.1", + ipAddr: "192.168.xx.xxx", + route: "192.168.xx.xxx", + gateway: "192.168.xx.xxx", netMask: "255.255.255.0", dnsServers: "1.1.1.1", domain: "2.2.2.2" diff --git a/zh-cn/application-dev/reference/apis/js-apis-net-sharing.md b/zh-cn/application-dev/reference/apis/js-apis-net-sharing.md index 75166c2be9e4fb15c7dcfa845b37c7d99421f167..fd4ed040b47b0a7729efc4eb4b30f43c98e9a8e2 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-net-sharing.md +++ b/zh-cn/application-dev/reference/apis/js-apis-net-sharing.md @@ -194,7 +194,8 @@ startSharing(type: SharingIfaceType, callback: AsyncCallback\): void ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.startSharing(0, (error) => { +let SHARING_WIFI=0; +sharing.startSharing(SHARING_WIFI, (error) => { console.log(JSON.stringify(error)); }); ``` @@ -242,7 +243,8 @@ startSharing(type: SharingIfaceType): Promise\ ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.startSharing(0).then(() => { +let SHARING_WIFI=0; +sharing.startSharing(SHARING_WIFI).then(() => { console.log("start wifi sharing successful"); }).catch(error => { console.log("start wifi sharing failed"); @@ -285,7 +287,8 @@ stopSharing(type: SharingIfaceType, callback: AsyncCallback\): void ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.stopSharing(0, (error) => { +let SHARING_WIFI=0; +sharing.stopSharing(SHARING_WIFI, (error) => { console.log(JSON.stringify(error)); }); ``` @@ -331,7 +334,8 @@ stopSharing(type: SharingIfaceType): Promise\ ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.stopSharing(0).then(() => { +let SHARING_WIFI=0; +sharing.stopSharing(SHARING_WIFI).then(() => { console.log("stop wifi sharing successful"); }).catch(error => { console.log("stop wifi sharing failed"); @@ -584,7 +588,8 @@ getSharingIfaces(state: SharingIfaceState, callback: AsyncCallback\ { +let SHARING_BLUETOOTH=2; +sharing.getSharingIfaces(SHARING_BLUETOOTH, (error, data) => { console.log(JSON.stringify(error)); console.log(JSON.stringify(data)); }); @@ -628,7 +633,8 @@ getSharingIfaces(state: SharingIfaceState): Promise\> ```js import SharingIfaceState from '@ohos.net.sharing' -sharing.getSharingIfaces(2).then(data => { +let SHARING_BLUETOOTH=2; +sharing.getSharingIfaces(SHARING_BLUETOOTH).then(data => { console.log(JSON.stringify(data)); }).catch(error => { console.log(JSON.stringify(error)); @@ -668,7 +674,8 @@ getSharingState(type: SharingIfaceType, callback: AsyncCallback\ { +let SHARING_WIFI=0; +sharing.getSharingState(SHARING_WIFI, (error, data) => { console.log(JSON.stringify(error)); console.log(JSON.stringify(data)); }); @@ -712,7 +719,8 @@ getSharingState(type: SharingIfaceType): Promise\ ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.getSharingState(0).then(data => { +let SHARING_WIFI=0; +sharing.getSharingState(SHARING_WIFI).then(data => { console.log(JSON.stringify(data)); }).catch(error => { console.log(JSON.stringify(error)); @@ -752,7 +760,8 @@ getSharableRegexes(type: SharingIfaceType, callback: AsyncCallback\ { +let SHARING_WIFI=0; +sharing.getSharableRegexes(SHARING_WIFI, (error, data) => { console.log(JSON.stringify(error)); console.log(JSON.stringify(data)); }); @@ -796,7 +805,8 @@ getSharableRegexes(type: SharingIfaceType): Promise\> ```js import SharingIfaceType from '@ohos.net.sharing' -sharing.getSharableRegexes(0).then(data => { +let SHARING_WIFI=0; +sharing.getSharableRegexes(SHARING_WIFI).then(data => { console.log(JSON.stringify(data)); }).catch(error => { console.log(JSON.stringify(error)); diff --git a/zh-cn/application-dev/reference/apis/js-apis-socket.md b/zh-cn/application-dev/reference/apis/js-apis-socket.md index 98396713aff1508626aa6817dc0f51f8691fc482..6b4ac84d3fa993cdd893ea81b42ab46ba42f1d29 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-socket.md +++ b/zh-cn/application-dev/reference/apis/js-apis-socket.md @@ -1813,7 +1813,7 @@ let options = { key: "xxxx", cert: "xxxx", ca: ["xxxx"], - passwd: "xxxx", + password: "xxxx", protocols: [socket.Protocol.TLSv12], useRemoteCipherPrefer: true, signatureAlgorithms: "rsa_pss_rsae_sha256:ECDSA+SHA256", @@ -1913,7 +1913,7 @@ let options = { key: "xxxx", cert: "xxxx", ca: ["xxxx"], - passwd: "xxxx", + password: "xxxx", protocols: [socket.Protocol.TLSv12], useRemoteCipherPrefer: true, signatureAlgorithms: "rsa_pss_rsae_sha256:ECDSA+SHA256", @@ -2515,7 +2515,7 @@ TLS安全相关操作,其中ca证书为必选参数,其他参数为可选参 | ca | string \| Array\ | 是 | 服务端的ca证书,用于认证校验服务端的数字证书。| | cert | string | 否 | 本地客户端的数字证书。 | | key | string | 否 | 本地数字证书的私钥。 | -| passwd | string | 否 | 读取私钥的密码。 | +| password | string | 否 | 读取私钥的密码。 | | protocols | [Protocol](#protocol9) \|Array\<[Protocol](#protocol9)> | 否 | TLS的协议版本。 | | useRemoteCipherPrefer | boolean | 否 | 优先使用对等方的密码套件。 | | signatureAlgorithms | string | 否 | 通信过程中的签名算法。 | @@ -2540,4 +2540,4 @@ TLS通信的协议版本。 | 类型 | 说明 | | --------------------------------------------------------------------- | --------------------- | -|[cryptoFramework.EncodingBlob](js-apis-cryptoFramework.md#datablob) | 存储证书的数据和编码格式 | \ No newline at end of file +|[cryptoFramework.EncodingBlob](js-apis-cryptoFramework.md#datablob) | 存储证书的数据和编码格式 |