24 lines
536 B
JavaScript
24 lines
536 B
JavaScript
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);
|
||
} |