fix: 重发验证码&图片路径

This commit is contained in:
zhangyahui
2025-10-30 13:54:11 +08:00
parent aad931182e
commit ca30dc0941
5 changed files with 19 additions and 12 deletions

View File

@@ -79,19 +79,19 @@ const validatePassword = (password: string) => {
const validateForm = () => {
// 验证邮箱
if (!formData.email) {
showToast('请输入邮箱地址')
showToast('place input your email')
return false
} else if (!validateEmail(formData.email)) {
showToast('请输入有效的邮箱地址')
showToast('please input valid email')
return false
}
// 验证密码
if (!formData.password) {
showToast('请输入密码')
showToast('please input password')
return false
} else if (!validatePassword(formData.password)) {
showToast('密码至少需要6位字符')
showToast('please input correct password')
return false
}

View File

@@ -22,6 +22,7 @@
v-else-if="step === 'verify'"
:ct="emailCode"
@nextStep="handleCheckVerifyCode"
@resend="handleSendVerifyCode"
/>
<Password v-else-if="step === 'password'" @sucess="handleSuccess" />
</div>
@@ -75,8 +76,10 @@ const handleStep = (type: 'mail' | 'verify' | 'password') => {
}
const handleSendVerifyCode = (data: any) => {
fromData.value.email = data.email
precheckEmail({ email: data.email }).then(() => {
if (data?.email) {
fromData.value.email = data?.email
}
precheckEmail({ email: fromData.value.email }).then(() => {
showToast('the verification code has been sent to your email')
handleStep('verify')
})

View File

@@ -2,7 +2,7 @@
<div class="mail-container">
<div class="label">Your Email</div>
<div class="input-group">
<input type="email" v-model="formData.email" placeholder="Email" class="input-field" />
<input type="email" v-model="formData.email" placeholder="Enter your email" class="input-field" />
</div>
<div class="btn" @click="handleNext">Next</div>
</div>

View File

@@ -48,7 +48,7 @@ const props = defineProps({
const agreePolicy = ref(false)
// Emits
const emit = defineEmits(['nextStep'])
const emit = defineEmits(['nextStep','resend'])
// Reactive data
const loading = ref(false)
@@ -83,6 +83,7 @@ const handleResend = () => {
if (countdown.value > 0) return
countdown.value = 60
handleSendVerifyCode()
emit('resend')
}
const handleConfirmCaptcha = () => {

View File

@@ -54,6 +54,9 @@ import { ref, watch } from 'vue'
import { useRouter } from 'vue-router'
import Video from './components/Video.vue'
import { useUserInfoStore } from '@/stores'
import male from '@/assets/images/male.png'
import female from '@/assets/images/female.png'
const router = useRouter()
const userInfoStore = useUserInfoStore()
@@ -64,28 +67,28 @@ const stylists = ref<any[]>([
value: 'mini',
name: 'Vera Lo',
description: 'Contemporary, Classic, Simple Silhouettes, Statement Pieces',
image: '/src/assets/images/female.png'
image: female
},
{
id: 2,
value: 'crystal',
name: 'Sarah Chen',
description: 'Modern, Edgy, Bold Colors, Street Style',
image: '/src/assets/images/male.png'
image: male
},
{
id: 3,
value: 'mini',
name: 'Emma Wilson',
description: 'Elegant, Feminine, Vintage Inspired, Soft Tones',
image: '/src/assets/images/female.png'
image: female
},
{
id: 4,
value: 'crystal',
name: 'Alex Johnson',
description: 'Minimalist, Professional, Neutral Palette, Clean Lines',
image: '/src/assets/images/male.png'
image: male
}
])
const currentChoosed = ref(1)