|
|
@@ -3,7 +3,6 @@ import {
|
|
|
} from "./utils/wxUtils"
|
|
|
App({
|
|
|
onLaunch: function () {
|
|
|
- wxSetSessionKey()
|
|
|
const updateManager = wx.getUpdateManager()
|
|
|
|
|
|
updateManager.onCheckForUpdate(function (res) {
|
|
|
@@ -33,4 +32,22 @@ App({
|
|
|
})
|
|
|
this.globalData = {}
|
|
|
},
|
|
|
+ onShow() {
|
|
|
+ this.checkEnvVersion()
|
|
|
+ },
|
|
|
+ checkEnvVersion() {
|
|
|
+ let v = wx.getAccountInfoSync()
|
|
|
+ let appVersion = wx.getStorageSync('appVersion')
|
|
|
+ let {
|
|
|
+ envVersion
|
|
|
+ } = v.miniProgram
|
|
|
+ if (appVersion != envVersion) {
|
|
|
+ wx.clearStorage({
|
|
|
+ success: (res) => {
|
|
|
+ wx.setStorageSync('appVersion', envVersion)
|
|
|
+ },
|
|
|
+ })
|
|
|
+ }
|
|
|
+ wxSetSessionKey()
|
|
|
+ }
|
|
|
})
|