mirror of
https://github.com/continew-org/continew-admin-ui.git
synced 2025-09-10 08:57:10 +08:00
fix: 仅生产环境检查版本更新
This commit is contained in:
@@ -65,13 +65,18 @@ const compareTag = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const isProd = import.meta.env.PROD
|
||||
onMounted(() => {
|
||||
// 每60秒检查一次是否有新的 ETag 或 Last-Modified 值
|
||||
timer = setInterval(compareTag, 6000)
|
||||
if (isProd) {
|
||||
// 每60秒检查一次是否有新的 ETag 或 Last-Modified 值
|
||||
timer = setInterval(compareTag, 6000)
|
||||
}
|
||||
})
|
||||
onUnmounted(() => {
|
||||
// 清除定时器
|
||||
clearInterval(timer)
|
||||
if (isProd) {
|
||||
// 清除定时器
|
||||
clearInterval(timer)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user