We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序中版本更新不会自动清空旧版本的缓存数据,有时候一些判断逻辑如果使用到了缓存,这就导致在更新后有可能没法及时用上新功能,因此在更新版本时候需要把旧版本的缓存数据清空。
方法一(不推荐): 在版本更新的时候,处理清除缓存操作 (利用小程序的 uni.getUpdateManager ) 参考文档
方法二:本地存储版本号, 然后更新后得到最新的版本号,两个版本号不等,然后处理逻辑 (已使用) 注:在APP.vue中的onShow生命周期执行,热启动也需要检测版本更新
// 更新正式环境版本时同步清空小程序缓存 const pre_version = uni.getStorageSync('version') || ''; const accountInfo = uni.getAccountInfoSync(); const cur_version = accountInfo.miniProgram.version; if (accountInfo.miniProgram.envVersion === 'release' && pre_version !== cur_version) { uni.clearStorageSync(); uni.setStorageSync("version", cur_version); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问题:
解决方法:
方法一(不推荐): 在版本更新的时候,处理清除缓存操作 (利用小程序的 uni.getUpdateManager )
参考文档
方法二:本地存储版本号, 然后更新后得到最新的版本号,两个版本号不等,然后处理逻辑 (已使用)
注:在APP.vue中的onShow生命周期执行,热启动也需要检测版本更新
The text was updated successfully, but these errors were encountered: