diff --git a/src/utils/validate.js b/src/utils/validate.js index a130010f2..659eeb346 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -39,3 +39,13 @@ export function isURL(s) { export function isCard(s) { return /^(\d{15}$)|(^\d{17}([0-9]|X)$)/.test(s); } +/** + * 护照 + * @param {*} s + */ +export function isPassport(s) { + let reg=/(^[EeKkGgDdSsPpHh]\d{8}$)|(^(([Ee][a-fA-F])|([DdSsPp][Ee])|([Kk][Jj])|([Mm][Aa])|(1[45]))\d{7}$)/; //护照(包括香港和澳门) + + + return reg.test(s); +} diff --git a/src/views/components/resiForm.vue b/src/views/components/resiForm.vue index 505fe55c0..014216e24 100644 --- a/src/views/components/resiForm.vue +++ b/src/views/components/resiForm.vue @@ -1,91 +1,115 @@