fix: 仅生产环境检查版本更新

This commit is contained in:
2024-07-03 23:18:47 +08:00
parent d959e77bf7
commit 327c28d830
2 changed files with 10 additions and 5 deletions

View File

@@ -11,7 +11,7 @@ export default function appInfo(): Plugin {
// eslint-disable-next-line no-console // eslint-disable-next-line no-console
console.log( console.log(
boxen( boxen(
`${bold(green(`${bgGreen('ContiNew Admin v3.1.0-SNAPSHOT')}`))}\n${cyan('在线文档:')}${underline('https://continew.top')}\n${cyan('持续迭代优化的前后端分离中后台管理系统框架。')}`, `${bold(green(`${bgGreen('ContiNew Admin v3.2.0-SNAPSHOT')}`))}\n${cyan('在线文档:')}${underline('https://continew.top')}\n${cyan('持续迭代优化的前后端分离中后台管理系统框架。')}`,
{ {
padding: 1, padding: 1,
margin: 1, margin: 1,

View File

@@ -65,13 +65,18 @@ const compareTag = async () => {
} }
} }
const isProd = import.meta.env.PROD
onMounted(() => { onMounted(() => {
// 每60秒检查一次是否有新的 ETag 或 Last-Modified 值 if (isProd) {
timer = setInterval(compareTag, 6000) // 每60秒检查一次是否有新的 ETag 或 Last-Modified 值
timer = setInterval(compareTag, 6000)
}
}) })
onUnmounted(() => { onUnmounted(() => {
// 清除定时器 if (isProd) {
clearInterval(timer) // 清除定时器
clearInterval(timer)
}
}) })
</script> </script>