Skip to content

Commit

Permalink
Merge branch 'metowolf-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Xm798 committed Mar 13, 2024
2 parents 5710b2e + d4b28f5 commit 8044b15
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions data/金融银行/广发银行.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ basic:
- 400830800
- 106980095508
- 106812895508
- 4008308003
url: https://www.cgbchina.com.cn/
7 changes: 7 additions & 0 deletions src/const/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import Joi from 'joi'
import libphonenumber from 'google-libphonenumber'

const checkPhone = (phone) => {
let phoneStr = `${phone}`
if (/^\+\d+ /.test(phoneStr)) {
phoneStr = phoneStr.replace(/^\+\d+ /, '')
}
if (/^\d+$/.test(phoneStr)) {
return true
}
const phoneUtil = libphonenumber.PhoneNumberUtil.getInstance()
const phoneNumber = phoneUtil.parseAndKeepRawInput(phone, 'CN')
return phoneUtil.isValidNumber(phoneNumber)
Expand Down

0 comments on commit 8044b15

Please sign in to comment.