移动端和 PC 端登录页都加了“图形验证码

This commit is contained in:
yml2213
2026-06-12 21:16:08 +08:00
parent 8cfb63a3e7
commit f6ea3e29a6
13 changed files with 456 additions and 84 deletions
@@ -26,15 +26,22 @@ export function useSmsCountdown() {
}
})
async function handleSendCode(phone: string) {
async function handleSendCode(
phone: string,
captcha?: { captchaId: string; captchaCode: string }
) {
if (!phone.trim()) {
showToast({ message: '请输入手机号', icon: 'warning-o' })
return false
}
if (!captcha?.captchaId || !captcha.captchaCode.trim()) {
showToast({ message: '请输入图形验证码', icon: 'warning-o' })
return false
}
sending.value = true
try {
await sendSmsCode(phone)
await sendSmsCode(phone, captcha.captchaId, captcha.captchaCode)
showToast({
message: '验证码已发送,请注意查收',
icon: 'passed',