美文网首页
手机和邮箱验证

手机和邮箱验证

作者: 学王 | 来源:发表于2022-03-18 11:58 被阅读0次
         if(!/^1[3456789]\d{9}$/.test(this.infoFrom.phone) && this.infoFrom.phone){
                        this.$message({
                            message: '手机格式错误!',
                            type: 'warning'
                        });
                        return false;
                    }
                    if(!/^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/.test(this.infoFrom.email) && this.infoFrom.email){
                            this.$message({
                                message: '邮箱格式错误!',
                                type: 'warning'
                            });
                            return false;
                    }
    
    

    相关文章

      网友评论

          本文标题:手机和邮箱验证

          本文链接:https://www.haomeiwen.com/subject/nopidrtx.html