onLaunch: function() {
// #ifdef MP-WEIXIN
// 版本热更新
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function(res) {
// 请求完新版本信息的回调
console.log('updata');
console.log(res.hasUpdate)
console.log('updata--end');
})
updateManager.onUpdateReady(function() {
wx.showModal({
title: '更新提示',
content: '检测到新版本,是否重启应用?',
success: function(res) {
if (res.confirm) {
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function() {
t.showToast('更新失败')
})
// #endif
},
微信小程序刷新
最新推荐文章于 2024-09-16 15:12:03 发布