// 倒计时
function countDown() {
// 是否显示验证码按钮
let show = true
// 初始值
let count = 0
// 定时器
let timer = null
// 禁止重复点击
if (!show) return
// 设置倒计时为60s
const TIME_COUNT = 60
if (!timer) {
count = TIME_COUNT
show = false
timer = setInterval(() => {
if (count > 0 && count <= TIME_COUNT) {
count--
// TODO: 执行倒计时
} else {
show = true
clearInterval(timer)
timer = null
// TODO: 倒计时结束
}
}, 1000)
}
}