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