From f506f84727f8bc8a54f4a6941a375fb3d3d834c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B1=9F=E6=B5=B7?= Date: Thu, 14 Jul 2022 12:36:42 +0000 Subject: [PATCH] =?UTF-8?q?Description:=20Fix=20ota=20demo=20Signed-off-by?= =?UTF-8?q?:=20=E6=B1=9F=E6=B5=B7=20https://gitee.c?= =?UTF-8?q?om/openharmony/docs/issues/I5H68B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reference/apis/js-apis-update.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 15a198a2c7..bacc0487bb 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\ { -- GitLab