restart能重启成功,但是页面还是没有更新,现在就是一直重启
let downloadTask = uni.downloadFile({
url: _this.tempFilePath, //下载热更新的链接
success: (downloadResult) => {
_this.percent = downloadResult
console.log(_this.percent)
plus.runtime.install(downloadResult
.tempFilePath, {
force: true
},
function() {
console.log('安装中')
// 应用热重启,重新启动进入首页。
// #ifdef APP-HARMONY
restart()
// plus.runtime.restart();
// #endif
},
function(e) {
console.log(e)
uni.showToast({
title: '安装失败',
icon: 'none'
})
})
console台打印
16:32:21.963 [响应]/souce/app_version {status: true, msg: {...}, code: 200} at utils/request.js:43
16:32:21.963 [boolean] true {version: "1.8.7", title: "测试wget包", descr: "测试wget", is_force: 0, downloadurl: "https://test.hy.aogoo.com/upload/187.wgt"} ==== at pages/index/index.vue:564
16:32:21.963 {version: "1.8.7", title: "测试wget包", descr: "测试wget", is_force: 0, downloadurl: "https://test.hy.aogoo.com/upload/187.wgt"} =更新内容 at components/upgrade-popup/upgrade-popup.vue:111
16:32:21.963 [boolean] false [boolean] false [boolean] false [boolean] false at components/upgrade-popup/upgrade-popup.vue:124
16:32:21.981 [响应]/mall/index {status: true, msg: {...}, code: 200} at utils/request.js:43
16:32:25.459 {tempFilePath: "/data/storage/el2/base/cache/HBuilder/uni-download/187(9).wgt", statusCode: 200, errMsg: "downloadFile:ok", errSubject: "downloadFile"} at components/upgrade-popup/upgrade-popup.vue:155
16:32:25.508 安装中 at components/upgrade-popup/upgrade-popup.vue:161
16:32:25.508 bundleInfo {name: "uni.app.UNI387D736", vendor: "example", versionCode: 186, versionName: "1.8.6", minCompatibleVersionCode: 186, ...} at uni_modules/harmony-restart/utssdk/app-harmony/index.uts:16
jc_heisenberg (作者)
OK,好的
2025-08-21 15:29