chore: refactor countdown logic and update utils4u auto imports
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user