| src/views/system/userinfo.vue | ●●●●● patch | view | raw | blame | history |
src/views/system/userinfo.vue
@@ -146,13 +146,15 @@ }); // 校验手机号 const validatePhone = () => { const phoneRegex = /^1[3-9]\d{9}$/; if (!phoneRegex.test(userInfo.value.phone)) { ElMessage.error('请输入正确的手机号码'); return false; const phone = userInfo.value.phone if (!phone) return true const phoneRegex = /^1[3-9]\d{9}$/ if (!phoneRegex.test(phone)) { ElMessage.error('请输入正确的手机号码') return false } return true; }; return true } // 校验邮箱 const validateEmail = () => { if (!userInfo.value.email) return true // 允许为空