Small fix

This commit is contained in:
saplf
2019-09-29 09:36:43 +08:00
parent a96137a714
commit 4e3ecd36b6
3 changed files with 5 additions and 8 deletions

View File

@@ -4,7 +4,7 @@
* @param input 输入
*/
function validPhone(input: string | number): boolean {
return /^1\d{10}$/.test(`${input || ''}`);
return /^\d+$/.test(`${input || ''}`);
}
/**
@@ -12,7 +12,7 @@ function validPhone(input: string | number): boolean {
* @param input 输入
*/
function validPhoneInput(input: string | number): boolean {
return /^(?:1\d*)?$/.test(`${input || ''}`);
return /^\d*$/.test(`${input || ''}`);
}
/**