|
|
@ -148,6 +148,7 @@ const smsVO = reactive({ |
|
|
|
} |
|
|
|
}) |
|
|
|
const mobileCodeTimer = ref(0) |
|
|
|
const msgTimer = ref<NodeJS.Timeout | number>() |
|
|
|
const redirect = ref<string>('') |
|
|
|
const getSmsCode = async () => { |
|
|
|
await getTenantId() |
|
|
@ -156,14 +157,19 @@ const getSmsCode = async () => { |
|
|
|
message.success(t('login.SmsSendMsg')) |
|
|
|
// 设置倒计时 |
|
|
|
mobileCodeTimer.value = 60 |
|
|
|
let msgTimer = setInterval(() => { |
|
|
|
msgTimer.value = setInterval(() => { |
|
|
|
mobileCodeTimer.value = mobileCodeTimer.value - 1 |
|
|
|
if (mobileCodeTimer.value <= 0) { |
|
|
|
clearInterval(msgTimer) |
|
|
|
clearInterval(msgTimer.value) |
|
|
|
} |
|
|
|
}, 1000) |
|
|
|
}) |
|
|
|
} |
|
|
|
onBeforeUnmount(() => { |
|
|
|
if(msgTimer.value){ |
|
|
|
clearInterval(msgTimer.value) |
|
|
|
} |
|
|
|
}) |
|
|
|
watch( |
|
|
|
() => currentRoute.value, |
|
|
|
(route: RouteLocationNormalizedLoaded) => { |
|
|
|