Commit 254f9558 authored by Damon's avatar Damon

版本更新时清空缓存

parent 7626ca51
...@@ -174,7 +174,7 @@ export default { ...@@ -174,7 +174,7 @@ export default {
//检查更新 //检查更新
checkUpdate: function () { checkUpdate: function () {
const updateManager = wx.getUpdateManager() const updateManager = wx.getUpdateManager()
console.log(updateManager)
updateManager.onCheckForUpdate(function (res) { updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调 // 请求完新版本信息的回调
console.log(res.hasUpdate) console.log(res.hasUpdate)
...@@ -185,7 +185,8 @@ export default { ...@@ -185,7 +185,8 @@ export default {
title: '更新提示', title: '更新提示',
content: '新版本已经准备好,是否重启应用?', content: '新版本已经准备好,是否重启应用?',
success(res) { success(res) {
if (res.confirm) { if (res.confirm) {
uni.clearStorageSync() // 清空本地缓存
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate() updateManager.applyUpdate()
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment