|
@@ -49,10 +49,11 @@ async function getVerificationCode() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 验证手机号格式
|
|
|
- const phoneRegex = /^1[3-9]\d{9}$/
|
|
|
- if (!phoneRegex.test(formData.value.phone)) {
|
|
|
- toast.error(t('auth.forgotPassword.error.invalidPhone'))
|
|
|
+ // 孟加拉手机号校验:可接受本地格式 01xxxxxxxxx (11 位) 或去掉前导 0 的 1xxxxxxxxx (10 位)
|
|
|
+ const phoneDigits = formData.value.phone.replace(/\D/g, '')
|
|
|
+ const bdPhoneRegex = /^0?1\d{9}$/
|
|
|
+ if (!bdPhoneRegex.test(phoneDigits)) {
|
|
|
+ toast.error(t('auth.register.error.invalidPhone'))
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -98,10 +99,11 @@ function handleStep1() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- // 验证手机号格式
|
|
|
- const phoneRegex = /^1[3-9]\d{9}$/
|
|
|
- if (!phoneRegex.test(formData.value.phone)) {
|
|
|
- toast.error(t('auth.forgotPassword.error.invalidPhone'))
|
|
|
+ // 孟加拉手机号校验:可接受本地格式 01xxxxxxxxx (11 位) 或去掉前导 0 的 1xxxxxxxxx (10 位)
|
|
|
+ const phoneDigits = formData.value.phone.replace(/\D/g, '')
|
|
|
+ const bdPhoneRegex = /^0?1\d{9}$/
|
|
|
+ if (!bdPhoneRegex.test(phoneDigits)) {
|
|
|
+ toast.error(t('auth.register.error.invalidPhone'))
|
|
|
return
|
|
|
}
|
|
|
|