数字大小写字母的校验(渠道ID)
export const checkNumChar = (id) => { var reg = /^[0-9a-zA-Z]*$/; if (reg.test(id)) { console.log(reg.test(id)); return true; } else { console.log(reg.test(id)); swal({ title:'请输入有效值', type:'error', timer:3000, showConfirmButton: true }); return false; } };
名称类:数字大小写字母汉字
export const checkName = (name) => { var reg = /^[0-9a-zA-Z\u4E00-\u9FA5\uF900-\uFA2D]*$/; if (reg.test(name)) { return true; } else { swal({ title:'请输入有效值', type:'error', timer:3000, showConfirmButton: true }); return false; } };