add version check

This commit is contained in:
2023-11-20 15:37:02 +08:00
parent 64e592391f
commit 15c3de24b3
4 changed files with 21 additions and 2 deletions

View File

@@ -4,9 +4,19 @@ import router from './router'
import { GetSelfAccount } from './api/account'
import { GetNotifactions } from './data/notifactions'
let currentVersion
import('@/version.js').then((versionModule) => {
currentVersion = versionModule.version
const savedVersion = localStorage.getItem('Version')
if (currentVersion && savedVersion && savedVersion !== currentVersion) {
alert('新的版本更新, 请按 Ctrl+F5 强制刷新页面')
}
localStorage.setItem('Version', currentVersion)
})
createApp(App).use(router).mount('#app')
GetSelfAccount()
GetNotifactions()