mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-11-10 19:23:42 +08:00
opt: 将短信发送按钮封装成组件
This commit is contained in:
11
web/src/utils/validate.js
Normal file
11
web/src/utils/validate.js
Normal file
@@ -0,0 +1,11 @@
|
||||
// 正则校验工具函数
|
||||
|
||||
export function validateEmail(email) {
|
||||
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||
return regex.test(email);
|
||||
}
|
||||
|
||||
export function validateMobile(mobile) {
|
||||
const regex = /^1[345789]\d{9}$/;
|
||||
return regex.test(mobile);
|
||||
}
|
||||
Reference in New Issue
Block a user