Files
zhxg_app_v1.0/api/helpFunc/index.js

24 lines
536 B
JavaScript
Raw Normal View History

2025-07-16 15:34:34 +08:00
import request from '@/utils/request'
//判断是否为空
export function isEmpty(obj) {
if (obj == null || obj == "" || obj == undefined) {
return true;
} else {
return false;
}
}
export function getDict(dict) {
return request({
'url': '/system/dict/data/type/' + dict,
'method': 'get'
})
}
// 手机号校验函数
export function isValidPhone(phone) {
// 中国大陆手机号以13、14、15、17、18、19开头共11位数字
const chinaPhoneRegex = /^1[3-9]\d{9}$/;
return chinaPhoneRegex.test(phone);
}