chore: refactor countdown logic and update utils4u auto imports
Some checks failed
/ build-and-deploy-to-vercel (push) Has been cancelled
/ depcheck (push) Successful in 1m42s
/ surge (push) Successful in 39s
/ playwright (push) Successful in 2m34s

This commit is contained in:
严浩
2025-02-08 10:39:36 +08:00
parent 1d5a387ae0
commit c465fd6fec
2 changed files with 12 additions and 3 deletions

View File

@ -9,7 +9,7 @@
</template>
<script setup lang="ts">
const { countdownTime, triggerCountdown, isCounting } = useCountdown($__DEV__ ? 5 : 60);
const { remaining: countdownTime, start: startCountdown, isActive: isCounting } = useCountdown($__DEV__ ? 3 : 60);
const isSending = ref(false);
const sendSms = async () => {
@ -17,7 +17,7 @@ const sendSms = async () => {
isSending.value = true;
try {
await new Promise((resolve) => setTimeout(resolve, 1000));
triggerCountdown();
startCountdown();
ToastService.add({ severity: 'info', summary: '提示', life: 3000, detail: '验证码发送成功' });
} finally {
isSending.value = false;