Files
zhxg_app_v1.0/api/helpFunc/index.js
2025-07-16 15:34:34 +08:00

24 lines
536 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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);
}