初始化仓库

This commit is contained in:
tao
2025-12-18 14:11:48 +08:00
parent e96f277a68
commit 54ec472bd4
1107 changed files with 158756 additions and 0 deletions

28
utils/judge.ts Normal file
View File

@@ -0,0 +1,28 @@
/**
* 判断传入的值是否有值(不为null,'',undefined)
* 有则返回true没有则返回false
* @param {number | string | object} value
* @return boolean
*/
export function hasValue(value : number | string | { [key: string]: any}):boolean{
if(typeof value == 'number' || typeof value == 'string'){
if(value != null && value != '' && value != undefined) return true
}
if(typeof value === 'object'){
for(let i in value){
if(value[i] != null && value[i] != '' && value[i] != undefined) return true
}
}
return false
}
/**
* 获取当前北京时间
* @return
*/
export function getBeijingTime():string{
//获取当前北京时间的时间戳(单位为毫秒)
const stamp= new Date().getTime() + 8 * 60 * 60 * 1000;
const beijingTime = new Date(stamp).toISOString().replace(/T/, ' ').replace(/\..+/, '').substring(0, 19);
return beijingTime
}