Uniapp 升级包

uni.downloadFile({
                        url: data.url,
                        success: (downloadResult) => {
                            if (downloadResult.statusCode === 200) {
                                plus.runtime.install(downloadResult.tempFilePath, {
                                    force: true
                                }, function() {
                                    console.log('install success...');
                                    uni.$u.toast('系统升级完毕')
                                    this.isupdate=false
                                    setTimeout(plus.runtime.restart(),2000)
                                    
                                }, function(e) {
                                    console.log(e)
                                    console.error('install fail...');
                                });
                            }
                        }
                    });

 

posted @ 2022-06-20 11:00  鲨鱼大王  阅读(42)  评论(0编辑  收藏  举报