Javascript // 验证邮箱的规则var checkEmail = (rule, value, cb) => {const regEmail = /^([a-zA-Z]|[0-9])(\w|-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/if (regEmail.test(value)) {// 合法的邮箱return cb()}cb(new Error('请输入合法的邮箱'))}// 验证手机号码的规则var checkMobile = (rule, value, cb) => {const regMobile = /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/if (regMobile.test(value)) {// 合法的手机号码return cb()}cb(new Error('手机号码格式不正确'))}