mirror of
https://github.com/Megghy/vtsuru.live.git
synced 2025-12-07 02:46:55 +08:00
add version check
This commit is contained in:
14
src/main.ts
14
src/main.ts
@@ -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()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user