From d24c9dde20cba23b96082b4db81b5223c75e4ea9 Mon Sep 17 00:00:00 2001 From: odc.xiaohui <xiaohui@Q1> Date: 星期三, 08 三月 2023 09:06:28 +0800 Subject: [PATCH] 身份证正反面调整 --- src/utils/validate.js | 28 ++++++++++++++++++++++++---- 1 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/utils/validate.js b/src/utils/validate.js index c8f70ca..03acd66 100644 --- a/src/utils/validate.js +++ b/src/utils/validate.js @@ -10,13 +10,33 @@ return urlregex.test(textval) } // 鏍¢獙姹夊瓧鍚� -export function validateName(str){ - +export function validateName(str) { + const rep = /^[\u4E00-\u9FA5]{2,4}$/; + return rep.test(str); } // 鏍¢獙鎵嬫満鍙� -export function validatePhone(str){ +export function validatePhone(str) { const phoneRep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/; return phoneRep.test(str); } - +// 鏍¢獙閭 +export function validateEmail(str) { + const rep = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/; + return rep.test(str); +} +// 楠岃瘉杞︾墝鍙� +export function validateCarNum(str){ + const regExp = /(^[浜触娌笣鍐�璞簯杈介粦婀樼殩椴佹柊鑻忔禉璧i剛妗傜敇鏅嬭挋闄曞悏闂借吹绮ら潚钘忓窛瀹佺惣浣块A-Z]{1}[A-Z]{1}[A-Z0-9]{4}[A-Z0-9鎸傚璀︽腐婢砞{1}$)/; + return regExp.test(str); +} +// 鏍¢獙鏁板瓧 +export function validateNum(str){ + const rep = /^[0-9]+(.[0-9]{1,3})?$/; + return rep.test(str); +} +// 楠岃瘉韬唤璇佸彿 +export function validateCardId(str){ + const rep=/^\d{15}|\d{}18$/ + return rep.test(str); +} -- Gitblit v1.8.0