This commit is contained in:
2025-09-07 17:35:42 +08:00
parent 2fb0f26b6d
commit dea68663ef

View File

@@ -175,7 +175,7 @@ export default {
comments: [],
statistics: null,
lastGenerateTime: 0,
cooldownTime: 5000, // 5秒冷却时间
cooldownTime: 3000, // 5秒冷却时间
isButtonDisabled: false
}
},
@@ -200,6 +200,13 @@ export default {
this.loadTypes()
// 启动定时器更新冷却时间显示
this.cooldownTimer = setInterval(() => {
// 检查倒计时是否结束如果结束则清空lastGenerateTime
if (this.lastGenerateTime > 0) {
const remaining = this.cooldownTime - (Date.now() - this.lastGenerateTime)
if (remaining <= 0) {
this.lastGenerateTime = 0
}
}
// 强制更新计算属性
this.$forceUpdate()
}, 1000)