diff --git a/frontend/.env b/frontend/.env index bcaaf67..b3477ea 100644 --- a/frontend/.env +++ b/frontend/.env @@ -1 +1,2 @@ -VITE_APP_ENV='prod' \ No newline at end of file +VITE_APP_ENV='prod' +VITE_APP_VERSION='1.0.1' \ No newline at end of file diff --git a/frontend/.env.development b/frontend/.env.development index b43e393..3213cae 100644 --- a/frontend/.env.development +++ b/frontend/.env.development @@ -1 +1,2 @@ -VITE_APP_ENV='dev' \ No newline at end of file +VITE_APP_ENV='dev' +VITE_APP_VERSION='0.9.0' \ No newline at end of file diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 658e1c7..e566052 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -3,13 +3,16 @@ import { onMounted, computed } from 'vue' import { useRoute } from 'vue-router' import { ConfigProvider } from 'ant-design-vue' import { useTheme } from './composables/useTheme.ts' +import { useUpdateChecker } from './composables/useUpdateChecker.ts' import AppLayout from './components/AppLayout.vue' import TitleBar from './components/TitleBar.vue' +import UpdateModal from './components/UpdateModal.vue' import zhCN from 'ant-design-vue/es/locale/zh_CN' import { logger } from '@/utils/logger' const route = useRoute() const { antdTheme, initTheme } = useTheme() +const { updateVisible, updateData, onUpdateConfirmed } = useUpdateChecker() // 判断是否为初始化页面 const isInitializationPage = computed(() => route.name === 'Initialization') @@ -35,6 +38,13 @@ onMounted(() => { + + + diff --git a/frontend/src/api/models/UpdateCheckIn.ts b/frontend/src/api/models/UpdateCheckIn.ts index 50588e2..4d66511 100644 --- a/frontend/src/api/models/UpdateCheckIn.ts +++ b/frontend/src/api/models/UpdateCheckIn.ts @@ -7,5 +7,9 @@ export type UpdateCheckIn = { * 当前前端版本号 */ current_version: string; + /** + * 是否强制拉取更新信息 + */ + if_force?: boolean; }; diff --git a/frontend/src/components/UpdateModal.vue b/frontend/src/components/UpdateModal.vue index c319fa0..d5d0d0c 100644 --- a/frontend/src/components/UpdateModal.vue +++ b/frontend/src/components/UpdateModal.vue @@ -5,10 +5,11 @@ :width="800" :footer="null" :mask-closable="false" + :z-index="9999" class="update-modal" > -
+