fix
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 15s
Docker Build & Deploy / Deploy to Production (push) Successful in 9s

This commit is contained in:
2026-01-02 19:21:47 +08:00
parent 9bbddfc0b1
commit f5c41c8be4

View File

@@ -42,6 +42,9 @@
<van-cell-group inset>
<van-cell title="查看日志" is-link @click="handleLogView" />
</van-cell-group>
<van-cell-group inset>
<van-cell title="清除缓存" is-link @click="handleClearCache" />
</van-cell-group>
<div class="detail-header" style="padding-bottom: 5px;">
<p>账户</p>
@@ -263,6 +266,29 @@ const handleLogout = async () => {
const handleLogView = () => {
router.push({ name: 'log' })
}
const handleClearCache = async () => {
try {
await showConfirmDialog({
title: '提示',
message: '确定要清除缓存吗?此操作不可撤销。',
})
// PWA程序强制页面更新到最新版本
if ('serviceWorker' in navigator && navigator.serviceWorker.controller) {
navigator.serviceWorker.controller.postMessage({ type: 'SKIP_WAITING' });
} else {
showToast('当前未使用缓存,无需清除')
return
}
showSuccessToast('缓存已清除')
} catch (error) {
console.error('取消清除缓存:', error)
showToast('已取消清除缓存')
}
}
</script>
<style scoped>