|
@@ -1,7 +1,9 @@
|
|
|
|
+import type { IdCard } from '@icon-park/vue-next'
|
|
|
|
+
|
|
const validator = {
|
|
const validator = {
|
|
mobile(rule: any, value: any, callback: any) {
|
|
mobile(rule: any, value: any, callback: any) {
|
|
if (!/^1\d{10}$/.test(value)) {
|
|
if (!/^1\d{10}$/.test(value)) {
|
|
- return new Error('请输入正确的手机号')
|
|
|
|
|
|
+ callback(new Error('请输入正确的手机号'))
|
|
}
|
|
}
|
|
callback()
|
|
callback()
|
|
},
|
|
},
|
|
@@ -10,6 +12,12 @@ const validator = {
|
|
callback(new Error('请输入正确的邮箱'))
|
|
callback(new Error('请输入正确的邮箱'))
|
|
}
|
|
}
|
|
callback()
|
|
callback()
|
|
|
|
+ },
|
|
|
|
+ idCard(rule: any, value: any, callback: any) {
|
|
|
|
+ if (!/^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X|x)$/.test(value)) {
|
|
|
|
+ callback(new Error('请输入正确的身份证号码'))
|
|
|
|
+ }
|
|
|
|
+ callback()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|