diff --git a/zh-cn/application-dev/reference/apis/js-apis-update.md b/zh-cn/application-dev/reference/apis/js-apis-update.md index 15a198a2c780b9419d8fee05e4dc997c8443afa1..bacc0487bb11473a903a14c10f5c94501868a9aa 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-update.md +++ b/zh-cn/application-dev/reference/apis/js-apis-update.md @@ -339,7 +339,7 @@ var versionDigestInfo = { // 下载选项 var downloadOptions = { - allowNetwork: update.NetType.CELLULAR_AND_WIFI, // 允许所有网络下载 + allowNetwork: update.NetType.CELLULAR, // 允许数据网络下载 order: update.Order.DOWNLOAD // 下载 } updater.download(versionDigestInfo, downloadOptions, (err) => { @@ -380,7 +380,7 @@ var versionDigestInfo = { // 下载选项 var downloadOptions = { - allowNetwork: update.NetType.CELLULAR_AND_WIFI, // 允许所有网络下载 + allowNetwork: update.NetType.CELLULAR, // 允许数据网络下载 order: update.Order.DOWNLOAD // 下载 } updater.download(versionDigestInfo, downloadOptions).then(() => { @@ -418,7 +418,7 @@ var versionDigestInfo = { // 恢复下载选项 var resumeDownloadOptions = { - allowNetwork: update.NetType.CELLULAR_AND_WIFI, // 允许所有网络下载 + allowNetwork: update.NetType.CELLULAR, // 允许数据网络下载 } updater.resumeDownload(versionDigestInfo, resumeDownloadOptions, (err) => { console.log(`resumeDownload error ${JSON.stringify(err)}`); @@ -458,7 +458,7 @@ var versionDigestInfo = { // 恢复下载选项 var resumeDownloadOptions = { - allowNetwork: update.NetType.CELLULAR_AND_WIFI, // 允许所有网络下载 + allowNetwork: update.NetType.CELLULAR, // 允许数据网络下载 } updater.resumeDownload(versionDigestInfo, resumeDownloadOptions).then(value => { console.log(`resumeDownload start`); @@ -773,7 +773,7 @@ setUpgradePolicy(policy: UpgradePolicy, callback: AsyncCallback\): void let policy = { downloadStrategy: false, autoUpgradeStrategy: false, - autoUpgradeInterval: [ 120, 240 ], // 自动升级时间段,用分钟表示 + autoUpgradePeriods: [ { start: 120, end: 240 } ] // 自动升级时间段,用分钟表示 } updater.setUpgradePolicy(policy, (err, value) => { console.log(`setUpgradePolicy result: ${value?}`); @@ -808,11 +808,11 @@ setUpgradePolicy(policy: UpgradePolicy): Promise\ let policy = { downloadStrategy: false, autoUpgradeStrategy: false, - autoUpgradeInterval: [ 120, 240 ], // 自动升级时间段,用分钟表示 + autoUpgradePeriods: [ { start: 120, end: 240 } ] // 自动升级时间段,用分钟表示 } -updater.setUpgradePolicy(policy).then(result => +updater.setUpgradePolicy(policy).then(result => { console.log(`setUpgradePolicy &{result}`); -).catch(err => { +}).catch(err => { console.log(`setUpgradePolicy promise error ${JSON.stringify(err)}`); }); ``` @@ -1095,7 +1095,7 @@ applyNewVersion(upgradeFiles: Array<[UpgradeFile](#upgradefile)>): Promise\ {