方法一、lodash
let postParams = {a:'',b:null,c:1};
postParams = _.omitBy(postParams, item => item === '' || _.isNull(item));
//{c:1}
方法二、原生js
for (let key in postParams) {
if (postParams[key] == null || postParams[key] == '') {
delete postParams[key];
}
}