Commit 5351bd8a authored by 张海景's avatar 张海景

update:加上参数过滤方法

parent 6f685c7e
...@@ -236,6 +236,25 @@ export function tansParams(params) { ...@@ -236,6 +236,25 @@ export function tansParams(params) {
return result; return result;
} }
/**
* 过滤对象中为空的属性
* @param obj
* @returns {*}
*/
export function filterObj(obj) {
if (!(typeof obj === 'object')) {
return
}
for (const key in obj) {
if (obj.hasOwnProperty(key) &&
(obj[key] === null || obj[key] === undefined)) {
obj[key] = ''
}
}
return obj
}
// 验证是否为blob格式 // 验证是否为blob格式
export async function blobValidate(data) { export async function blobValidate(data) {
try { try {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment