//重置对象属性
export function resetParams(params: { [key: string]: any }) {
  Object.keys(params).forEach((key: string) => {
    let keyVal = params[key];
    let type = typeof keyVal;
    if (type === "undefined") params[key] = undefined;
    if (type === "string") params[key] = "";
    if (type === "number") params[key] = 0;
    if (type === "object") {
      if (Array.isArray(keyVal)) params[key] = [];
      if (Object.prototype.toString.call(keyVal) === "[object Object]")
        params[key] = {};
    }
  });
}
