first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
class Utils {
isPhone(phone) {
let myreg = /^1[3-9]\d{9}$/;
return myreg.test(phone)
}
// 密码中必须包含大小写 字母、数字、特称字符,至少6个字符,最多20个字符;
checkPwd(pwd) {
// 这个正则有问题,自己找个
let pwdRegex = /(?=.*[0-9])(?=.*[a-zA-Z])(?=.*[`~!@#$%^&*()-=_+;':",./<>?])(?=\S+$).{6,32}/;
return pwdRegex.test(pwd)
}
setItem(key, value) {
localStorage.setItem(
key,
value.constructor == Object || value.constructor == Array
? JSON.stringify(value)
: value
)
}
getItem(key) {
return localStorage.getItem(key) == null ? false : JSON.parse(localStorage.getItem(key))
}
}
export default new Utils