账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    uniApp 更新版本提示没有触发
    42
    0
    问题描述uniApp 小程序更新版本后,在app.vue 中使用一下代码,没有提示。但是在开发者工具中是可以的,但是正式版本就不行这个是为什么?提交代码有什么要求吗?onCheckForUpdate 函数返回的 hasUpdate 始终是false问题出现的环境背景及自己尝试过哪些方法相关代码粘贴代码文本(请勿用截图)export default { onLaunch: function() { const updateManager = uni.getUpdateManager(); console.log('updateManager---',updateManager); updateManager.onCheckForUpdate(function(res) { console.log('onCheckForUpdate---',res); // 请求完新版本信息的回调 if (res.hasUpdate) { updateManager.onUpdateReady(function(res2) { console.log('onUpdateReady---',res2) uni.clearStorageSync() // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate() // uni.showModal({ // title: '更新提示', // content: '发现新版本,是否重启应用?', // showCancel: false, // cancelColor:'#eeeeee', // confirmColor:'#FF0000', // success(res3) { // console.log('res3',res3); // if (res3.confirm) { // uni.clearStorageSync() // // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // updateManager.applyUpdate(); // } // } // }); }); } }); updateManager.onUpdateFailed(function(res) { console.log('onUpdateFailed---失败',res); // 新的版本下载失败 uni.showModal({ title: '提示', content: '检查到有新版本,但下载失败,请检查网络设置', success(res) { if (res.confirm) { // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 updateManager.applyUpdate(); } } }); });}, }你期待的结果是什么?实际看到的错误信息又是什么?
    0
    打赏
    收藏
    点击回答
        全部回答
    • 0
    更多回答
    扫一扫访问手机版
    • 回到顶部
    • 回到顶部