// 删除对象中值为 undefined、空字符串、空数据、空对象的属性
function removeEmptyStringAttr(obj) {
  Object.keys(obj).forEach(key => {

    const val = obj[key];
    if (isObject(val)) {
      removeEmptyStringAttr(val);

      const valKeys = Object.keys(val);
      if (!valKeys.length) {
        delete obj[key];
      }
    } else if (Array.isArray(val)) {
      if (val.length === 0) {
        delete obj[key];
      } else {
        val.forEach(item => {
          if (Array.isArray(item) || isObject(item)) {
            removeEmptyStringAttr(item);
          }
        });
      }
    } else if (val === '' || val === undefined || val === null) {
      delete obj[key];
    }
  });

  return obj;
}

removeEmptyStringAttr({
  "condition": {
    "vidin": [],
    "vidout": [12],
    "youkuVideoAttr": {
      "isshow": "",
      "ispay": "0",
      "showOriginal": 1,
      "issample": false,
      "productionShowOriginal": 0
    },
    "uidin": [],
    "youkuShowAttr": {
      "productionrelation": "",
      "showispay": ""
    }
  },
  "policy":[{"deviceDisabled":[],"areaDisabled":["TW"],"siteDisabled":[],"uaDisabled":[],"appleDisabled":2}],
  "videoPermissions":{"downloadDisabled":"0"},
  "list": [1, '', {}, {a: ''}]
});