|
@@ -71,12 +71,24 @@ App({
|
|
|
//版本判断
|
|
|
checkVersion() {
|
|
|
const oldVersion = wx.getStorageSync('version') || null;
|
|
|
+ //若当前无缓存
|
|
|
+ let infoList = wx.getStorageInfoSync()
|
|
|
+ console.log(infoList);
|
|
|
+ if(infoList.keys.length <= 0) {
|
|
|
+ //缓存当前版本
|
|
|
+ wx.setStorageSync('version', versionConfig.version)
|
|
|
+ return;
|
|
|
+ }
|
|
|
//当前无版本号或大版本更新
|
|
|
if (!oldVersion || Number(versionConfig.version.split('.')[0]) > Number(oldVersion.split('.')[0])) {
|
|
|
let infoList = wx.getStorageInfoSync()
|
|
|
infoList.keys.forEach(item => {
|
|
|
wx.removeStorageSync(item)
|
|
|
});
|
|
|
+ wx.showModal({
|
|
|
+ content: '小程序已升级到2.0.10,请重新认证后使用',
|
|
|
+ complete: (res) => {}
|
|
|
+ })
|
|
|
}
|
|
|
//缓存当前版本
|
|
|
wx.setStorageSync('version', versionConfig.version)
|