2019-02-19 16:04:29 +08:00

5 lines
178 B
TypeScript

export function isMobile(value: string): boolean {
value = value.replace(/[^-|\d]/g, '');
return /^((\+86)|(86))?(1)\d{10}$/.test(value) || /^0[0-9-]{10,13}$/.test(value);
}