123456789101112 |
- //检查手机号
- export const ifMobilePhone = (phone) => {
- if (parseInt(phone) < 10000000000 || parseInt(phone) > 99999999999) { //检查长度
- return false
- }
- var reg = /^[1][3,4,5,6,7,8,9][0-9]{9}$/ //检查规则
- if (!reg.test(phone)) {
- return false;
- } else {
- return true;
- }
- }
|