mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-07 00:36:41 +08:00
feat(pwa): 重构 Service Worker 及版本更新机制
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
<script lang="ts" setup>
|
||||
import { formatDateDifference } from '@/@core/utils/formatters'
|
||||
import api from '@/api'
|
||||
import { clearCachesAndServiceWorker } from '@/composables/useVersionChecker'
|
||||
import { clearCachesAndServiceWorker, reloadWithTimestamp } from '@/composables/useVersionChecker'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import { useDisplay } from 'vuetify'
|
||||
|
||||
declare const __APP_VERSION__: string
|
||||
|
||||
// 国际化
|
||||
const { t } = useI18n()
|
||||
|
||||
@@ -124,8 +122,8 @@ function releaseTime(releaseDate: string) {
|
||||
// 强制清除缓存
|
||||
async function cleanCache() {
|
||||
await clearCachesAndServiceWorker()
|
||||
// 刷新页面
|
||||
window.location.reload()
|
||||
// 刷新页面,添加时间戳参数以强制更新
|
||||
reloadWithTimestamp()
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user