移动端V1.0
This commit is contained in:
24
api/helpFunc/index.js
Normal file
24
api/helpFunc/index.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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);
|
||||
}
|
Reference in New Issue
Block a user