源文件

This commit is contained in:
gyq
2024-05-23 14:39:33 +08:00
commit a1128dd791
2997 changed files with 500069 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
// 校验手机号
function REG_Phone(arg) {
const reg = /^1\d{10}$/
return reg.test(arg)
}
// 校验邮箱
function REG_Email(arg) {
const reg = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
return reg.test(arg)
}
// 校验登录名
function REG_LoginName(arg) {
const reg = /^[a-zA-Z][a-zA-Z0-9]{5,19}$/
return !!arg && reg.test(arg)
}
// 非空校验
function REG_NotNUll(arg) {
return !!arg
}
// 校验货币金额 真能是正数包含小数点
function takeMoney(arg) {
const reg = /(?:^[1-9]([0-9]+)?(?:\.[0-9]{1,2})?$)|(?:^(?:0)$)|(?:^[0-9]\.[0-9](?:[0-9])?$)/
return reg.test(arg)
}
// 检验网址链接
function httpOrHttps(arg) {
const reg = /^(http|https)/
return reg.test(arg)
}
export default {
REG_Phone,
REG_Email,
REG_LoginName,
REG_NotNUll,
takeMoney,
httpOrHttps,
}