From b46aa8e8cf2eacc3a02e459dcce0a44ff25f2f63 Mon Sep 17 00:00:00 2001 From: Megghy Date: Mon, 20 Nov 2023 19:06:06 +0800 Subject: [PATCH] update version check --- src/main.ts | 18 +++++++++++------- src/views/open_live/MusicRequest.vue | 11 ++++++----- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/main.ts b/src/main.ts index 4ad81d7..9e77431 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,3 +1,5 @@ +import { QueryGetAPI } from '@/api/query' +import { BASE_API } from '@/data/constants' import { createApp } from 'vue' import App from './App.vue' import router from './router' @@ -5,15 +7,17 @@ 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') +QueryGetAPI(BASE_API + 'vtsuru/version').then((version) => { + if (version.code == 200) { + currentVersion = version.data + const savedVersion = localStorage.getItem('Version') - if (currentVersion && savedVersion && savedVersion !== currentVersion) { - alert('新的版本更新, 请按 Ctrl+F5 强制刷新页面') + if (currentVersion && savedVersion && savedVersion !== currentVersion) { + alert('发现新的版本更新, 请按 Ctrl+F5 强制刷新页面') + } + + localStorage.setItem('Version', currentVersion) } - - localStorage.setItem('Version', currentVersion) }) createApp(App).use(router).mount('#app') diff --git a/src/views/open_live/MusicRequest.vue b/src/views/open_live/MusicRequest.vue index f33e289..9c9c933 100644 --- a/src/views/open_live/MusicRequest.vue +++ b/src/views/open_live/MusicRequest.vue @@ -825,6 +825,12 @@ onUnmounted(() => { 前往登录或注册 + + + 不要同时开多个页面, 会导致点歌重复! 可以考虑使用 + VtsuruEventFetcher + , 部署后还可以记录SC和上舰历史 +
@@ -834,11 +840,6 @@ onUnmounted(() => { {{ configCanEdit ? '' : '登陆后才可以使用此功能' }} - - 不要同时开多个页面, 会导致点歌重复! 可以考虑使用 - VtsuruEventFetcher - , 部署后还可以记录SC和上舰历史 -