From 4641a877cd6a94e4d35dca7f7f14bc1443e2d2ad Mon Sep 17 00:00:00 2001
From: luobisheng <727299681@qq.com>
Date: 星期二, 29 十一月 2022 17:59:55 +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